
/* start /scripts/libs/ramda-0.23.0.min.js*/
//  Ramda v0.23.0
//  https://github.com/ramda/ramda
//  (c) 2013-2016 Scott Sauyet, Michael Hurley, and David Chambers
//  Ramda may be freely distributed under the MIT license.

(function(){"use strict";var t={"@@functional/placeholder":!0},n=function(t,n){for(var r=0,e=n.length-(t-1),u=new Array(e>=0?e:0);e>r;)u[r]=Array.prototype.slice.call(n,r,r+t),r+=1;return u},r=function(t,n){switch(t){case 0:return function(){return n.apply(this,arguments)};case 1:return function(t){return n.apply(this,arguments)};case 2:return function(t,r){return n.apply(this,arguments)};case 3:return function(t,r,e){return n.apply(this,arguments)};case 4:return function(t,r,e,u){return n.apply(this,arguments)};case 5:return function(t,r,e,u,i){return n.apply(this,arguments)};case 6:return function(t,r,e,u,i,o){return n.apply(this,arguments)};case 7:return function(t,r,e,u,i,o,c){return n.apply(this,arguments)};case 8:return function(t,r,e,u,i,o,c,a){return n.apply(this,arguments)};case 9:return function(t,r,e,u,i,o,c,a,s){return n.apply(this,arguments)};case 10:return function(t,r,e,u,i,o,c,a,s,f){return n.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}},e=function(t){for(var n,r=[];!(n=t.next()).done;)r.push(n.value);return r},u=function(t){return new RegExp(t.source,(t.global?"g":"")+(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.sticky?"y":"")+(t.unicode?"u":""))},i=function(t){return function(){return!t.apply(this,arguments)}},o=function(t,n){t=t||[],n=n||[];var r,e=t.length,u=n.length,i=[];for(r=0;e>r;)i[i.length]=t[r],r+=1;for(r=0;u>r;)i[i.length]=n[r],r+=1;return i},c=function(t,n,r){for(var e=0,u=r.length;u>e;){if(t(n,r[e]))return!0;e+=1}return!1},a=function(t,n){for(var r=n.length-1;r>=0&&t(n[r]);)r-=1;return Array.prototype.slice.call(n,0,r+1)},s=function(t,n){for(var r=0,e=n.length,u=[];e>r;)t(n[r])&&(u[u.length]=n[r]),r+=1;return u},f=function(t){return{"@@transducer/value":t,"@@transducer/reduced":!0}},l=function(t){var n=String(t).match(/^function (\w*)/);return null==n?"":n[1]},p=function(t,n){return Object.prototype.hasOwnProperty.call(n,t)},h=function(t){return t},g=function(){var t=Object.prototype.toString;return"[object Arguments]"===t.call(arguments)?function(n){return"[object Arguments]"===t.call(n)}:function(t){return p("callee",t)}}(),y=Array.isArray||function(t){return null!=t&&t.length>=0&&"[object Array]"===Object.prototype.toString.call(t)},d=function(t){return"[object Function]"===Object.prototype.toString.call(t)},m=Number.isInteger||function(t){return t<<0===t},v=function(t){return"[object Number]"===Object.prototype.toString.call(t)},w=function(t){return"[object Object]"===Object.prototype.toString.call(t)},b=function(t){return null!=t&&"object"==typeof t&&t["@@functional/placeholder"]===!0},x=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},A=function(t){return"[object String]"===Object.prototype.toString.call(t)},j=function(t){return"function"==typeof t["@@transducer/step"]},O=function(t,n){for(var r=0,e=n.length,u=Array(e);e>r;)u[r]=t(n[r]),r+=1;return u},S=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1,e=arguments.length;e>r;){var u=arguments[r];if(null!=u)for(var i in u)p(i,u)&&(n[i]=u[i]);r+=1}return n},E=function(t){return[t]},_=function(t,n){return function(){return n.call(this,t.apply(this,arguments))}},k=function(t,n){return function(){var r=this;return t.apply(r,arguments).then(function(t){return n.call(r,t)})}},N=function(t){var n=t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return'"'+n.replace(/"/g,'\\"')+'"'},I=function(t){return t&&t["@@transducer/reduced"]?t:{"@@transducer/value":t,"@@transducer/reduced":!0}},q=function(){var t=function(t){return(10>t?"0":"")+t};return"function"==typeof Date.prototype.toISOString?function(t){return t.toISOString()}:function(n){return n.getUTCFullYear()+"-"+t(n.getUTCMonth()+1)+"-"+t(n.getUTCDate())+"T"+t(n.getUTCHours())+":"+t(n.getUTCMinutes())+":"+t(n.getUTCSeconds())+"."+(n.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"}}(),W={init:function(){return this.xf["@@transducer/init"]()},result:function(t){return this.xf["@@transducer/result"](t)}},C=function(){function t(t){this.f=t}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(t){return t},t.prototype["@@transducer/step"]=function(t,n){return this.f(t,n)},function(n){return new t(n)}}(),P="function"==typeof Object.assign?Object.assign:S,T=function(t,n){return function(){var r=arguments.length;if(0===r)return n();var e=arguments[r-1];return y(e)||"function"!=typeof e[t]?n.apply(this,arguments):e[t].apply(e,Array.prototype.slice.call(arguments,0,r-1))}},F=function(t){return function n(r){return 0===arguments.length||b(r)?n:t.apply(this,arguments)}},B=function(t){return function n(r,e){switch(arguments.length){case 0:return n;case 1:return b(r)?n:F(function(n){return t(r,n)});default:return b(r)&&b(e)?n:b(r)?F(function(n){return t(n,e)}):b(e)?F(function(n){return t(r,n)}):t(r,e)}}},U=function(t){return function n(r,e,u){switch(arguments.length){case 0:return n;case 1:return b(r)?n:B(function(n,e){return t(r,n,e)});case 2:return b(r)&&b(e)?n:b(r)?B(function(n,r){return t(n,e,r)}):b(e)?B(function(n,e){return t(r,n,e)}):F(function(n){return t(r,e,n)});default:return b(r)&&b(e)&&b(u)?n:b(r)&&b(e)?B(function(n,r){return t(n,r,u)}):b(r)&&b(u)?B(function(n,r){return t(n,e,r)}):b(e)&&b(u)?B(function(n,e){return t(r,n,e)}):b(r)?F(function(n){return t(n,e,u)}):b(e)?F(function(n){return t(r,n,u)}):b(u)?F(function(n){return t(r,e,n)}):t(r,e,u)}}},R=function Mu(t,n,e){return function(){for(var u=[],i=0,o=t,c=0;c<n.length||i<arguments.length;){var a;c<n.length&&(!b(n[c])||i>=arguments.length)?a=n[c]:(a=arguments[i],i+=1),u[c]=a,b(a)||(o-=1),c+=1}return 0>=o?e.apply(this,u):r(o,Mu(t,u,e))}},M=function(t,n,r){return function(){if(0===arguments.length)return r();var e=Array.prototype.slice.call(arguments,0),u=e.pop();if(!y(u)){for(var i=0;i<t.length;){if("function"==typeof u[t[i]])return u[t[i]].apply(u,e);i+=1}if(j(u)){var o=n.apply(null,e);return o(u)}}return r.apply(this,arguments)}},L=function(){function t(t,n){this.xf=n,this.f=t,this.all=!0}return t.prototype["@@transducer/init"]=W.init,t.prototype["@@transducer/result"]=function(t){return this.all&&(t=this.xf["@@transducer/step"](t,!0)),this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,n){return this.f(n)||(this.all=!1,t=I(this.xf["@@transducer/step"](t,!1))),t},B(function(n,r){return new t(n,r)})}(),D=function(){function t(t,n){this.xf=n,this.f=t,this.any=!1}return t.prototype["@@transducer/init"]=W.init,t.prototype["@@transducer/result"]=function(t){return this.any||(t=this.xf["@@transducer/step"](t,!1)),this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,n){return this.f(n)&&(this.any=!0,t=I(this.xf["@@transducer/step"](t,!0))),t},B(function(n,r){return new t(n,r)})}(),z=function(){function t(t,n){this.xf=n,this.pos=0,this.full=!1,this.acc=new Array(t)}return t.prototype["@@transducer/init"]=W.init,t.prototype["@@transducer/result"]=function(t){return this.acc=null,this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,n){return this.store(n),this.full?this.xf["@@transducer/step"](t,this.getCopy()):t},t.prototype.store=function(t){this.acc[this.pos]=t,this.pos+=1,this.pos===this.acc.length&&(this.pos=0,this.full=!0)},t.prototype.getCopy=function(){return o(Array.prototype.slice.call(this.acc,this.pos),Array.prototype.slice.call(this.acc,0,this.pos))},B(function(n,r){return new t(n,r)})}(),V=function(){function t(t,n){this.xf=n,this.n=t}return t.prototype["@@transducer/init"]=W.init,t.prototype["@@transducer/result"]=W.result,t.prototype["@@transducer/step"]=function(t,n){return this.n>0?(this.n-=1,t):this.xf["@@transducer/step"](t,n)},B(function(n,r){return new t(n,r)})}(),K=function(){function t(t,n){this.xf=n,this.pos=0,this.full=!1,this.acc=new Array(t)}return t.prototype["@@transducer/init"]=W.init,t.prototype["@@transducer/result"]=function(t){return this.acc=null,this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,n){return this.full&&(t=this.xf["@@transducer/step"](t,this.acc[this.pos])),this.store(n),t},t.prototype.store=function(t){this.acc[this.pos]=t,this.pos+=1,this.pos===this.acc.length&&(this.pos=0,this.full=!0)},B(function(n,r){return new t(n,r)})}(),$=function(){function t(t,n){this.xf=n,this.pred=t,this.lastValue=void 0,this.seenFirstValue=!1}return t.prototype["@@transducer/init"]=W.init,t.prototype["@@transducer/result"]=W.result,t.prototype["@@transducer/step"]=function(t,n){var r=!1;return this.seenFirstValue?this.pred(this.lastValue,n)&&(r=!0):this.seenFirstValue=!0,this.lastValue=n,r?t:this.xf["@@transducer/step"](t,n)},B(function(n,r){return new t(n,r)})}(),H=function(){function t(t,n){this.xf=n,this.f=t}return t.prototype["@@transducer/init"]=W.init,t.prototype["@@transducer/result"]=W.result,t.prototype["@@transducer/step"]=function(t,n){if(this.f){if(this.f(n))return t;this.f=null}return this.xf["@@transducer/step"](t,n)},B(function(n,r){return new t(n,r)})}(),X=function(){function t(t,n){this.xf=n,this.f=t}return t.prototype["@@transducer/init"]=W.init,t.prototype["@@transducer/result"]=W.result,t.prototype["@@transducer/step"]=function(t,n){return this.f(n)?this.xf["@@transducer/step"](t,n):t},B(function(n,r){return new t(n,r)})}(),Y=function(){function t(t,n){this.xf=n,this.f=t,this.found=!1}return t.prototype["@@transducer/init"]=W.init,t.prototype["@@transducer/result"]=function(t){return this.found||(t=this.xf["@@transducer/step"](t,void 0)),this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,n){return this.f(n)&&(this.found=!0,t=I(this.xf["@@transducer/step"](t,n))),t},B(function(n,r){return new t(n,r)})}(),Z=function(){function t(t,n){this.xf=n,this.f=t,this.idx=-1,this.found=!1}return t.prototype["@@transducer/init"]=W.init,t.prototype["@@transducer/result"]=function(t){return this.found||(t=this.xf["@@transducer/step"](t,-1)),this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,n){return this.idx+=1,this.f(n)&&(this.found=!0,t=I(this.xf["@@transducer/step"](t,this.idx))),t},B(function(n,r){return new t(n,r)})}(),G=function(){function t(t,n){this.xf=n,this.f=t}return t.prototype["@@transducer/init"]=W.init,t.prototype["@@transducer/result"]=function(t){return this.xf["@@transducer/result"](this.xf["@@transducer/step"](t,this.last))},t.prototype["@@transducer/step"]=function(t,n){return this.f(n)&&(this.last=n),t},B(function(n,r){return new t(n,r)})}(),J=function(){function t(t,n){this.xf=n,this.f=t,this.idx=-1,this.lastIdx=-1}return t.prototype["@@transducer/init"]=W.init,t.prototype["@@transducer/result"]=function(t){return this.xf["@@transducer/result"](this.xf["@@transducer/step"](t,this.lastIdx))},t.prototype["@@transducer/step"]=function(t,n){return this.idx+=1,this.f(n)&&(this.lastIdx=this.idx),t},B(function(n,r){return new t(n,r)})}(),Q=function(){function t(t,n){this.xf=n,this.f=t}return t.prototype["@@transducer/init"]=W.init,t.prototype["@@transducer/result"]=W.result,t.prototype["@@transducer/step"]=function(t,n){return this.xf["@@transducer/step"](t,this.f(n))},B(function(n,r){return new t(n,r)})}(),tt=function(){function t(t,n,r,e){this.valueFn=t,this.valueAcc=n,this.keyFn=r,this.xf=e,this.inputs={}}return t.prototype["@@transducer/init"]=W.init,t.prototype["@@transducer/result"]=function(t){var n;for(n in this.inputs)if(p(n,this.inputs)&&(t=this.xf["@@transducer/step"](t,this.inputs[n]),t["@@transducer/reduced"])){t=t["@@transducer/value"];break}return this.inputs=null,this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,n){var r=this.keyFn(n);return this.inputs[r]=this.inputs[r]||[r,this.valueAcc],this.inputs[r][1]=this.valueFn(this.inputs[r][1],n),t},R(4,[],function(n,r,e,u){return new t(n,r,e,u)})}(),nt=function(){function t(t,n){this.xf=n,this.n=t,this.i=0}return t.prototype["@@transducer/init"]=W.init,t.prototype["@@transducer/result"]=W.result,t.prototype["@@transducer/step"]=function(t,n){this.i+=1;var r=0===this.n?t:this.xf["@@transducer/step"](t,n);return this.i>=this.n?I(r):r},B(function(n,r){return new t(n,r)})}(),rt=function(){function t(t,n){this.xf=n,this.f=t}return t.prototype["@@transducer/init"]=W.init,t.prototype["@@transducer/result"]=W.result,t.prototype["@@transducer/step"]=function(t,n){return this.f(n)?this.xf["@@transducer/step"](t,n):I(t)},B(function(n,r){return new t(n,r)})}(),et=B(function(t,n){return Number(t)+Number(n)}),ut=U(function(t,n,r){if(n>=r.length||n<-r.length)return r;var e=0>n?r.length:0,u=e+n,i=o(r);return i[u]=t(r[u]),i}),it=B(M(["all"],L,function(t,n){for(var r=0;r<n.length;){if(!t(n[r]))return!1;r+=1}return!0})),ot=F(function(t){return function(){return t}}),ct=B(function(t,n){return t&&n}),at=B(M(["any"],D,function(t,n){for(var r=0;r<n.length;){if(t(n[r]))return!0;r+=1}return!1})),st=B(M([],z,n)),ft=B(function(t,n){return o(n,[t])}),lt=B(function(t,n){return t.apply(this,n)}),pt=U(function(t,n,r){var e=t(n),u=t(r);return u>e?-1:e>u?1:0}),ht=U(function(t,n,r){var e={};for(var u in r)e[u]=r[u];return e[t]=n,e}),gt=U(function Lu(t,n,r){if(0===t.length)return n;var e=t[0];if(t.length>1){var u=p(e,r)?r[e]:m(t[1])?[]:{};n=Lu(Array.prototype.slice.call(t,1),n,u)}if(m(e)&&y(r)){var i=[].concat(r);return i[e]=n,i}return ht(e,n,r)}),yt=B(function(t,n){return r(t.length,function(){return t.apply(n,arguments)})}),dt=U(function(t,n,r){if(t>n)throw new Error("min must not be greater than max in clamp(min, max, value)");return t>r?t:r>n?n:r}),mt=F(function(t){return function(n,r){return t(n,r)?-1:t(r,n)?1:0}}),vt=B(function(t,n){return 1===t?F(n):r(t,R(t,[],n))}),wt=et(-1),bt=B(function(t,n){return null==n||n!==n?t:n}),xt=U(function(t,n,r){var e=t(n),u=t(r);return e>u?-1:u>e?1:0}),At=U(function(t,n,r){for(var e=[],u=0,i=n.length;i>u;)c(t,n[u],r)||c(t,n[u],e)||e.push(n[u]),u+=1;return e}),jt=B(function(t,n){var r={};for(var e in n)r[e]=n[e];return delete r[t],r}),Ot=B(function Du(t,n){switch(t.length){case 0:return n;case 1:return jt(t[0],n);default:var r=t[0],e=Array.prototype.slice.call(t,1);return null==n[r]?n:ht(r,Du(e,n[r]),n)}}),St=B(function(t,n){return t/n}),Et=B(M(["dropWhile"],H,function(t,n){for(var r=0,e=n.length;e>r&&t(n[r]);)r+=1;return Array.prototype.slice.call(n,r)})),_t=F(function(t){return null!=t&&"function"==typeof t.empty?t.empty():null!=t&&null!=t.constructor&&"function"==typeof t.constructor.empty?t.constructor.empty():y(t)?[]:A(t)?"":w(t)?{}:g(t)?function(){return arguments}():void 0}),kt=B(function zu(t,n){var r,e,u,i={};for(e in n)r=t[e],u=typeof r,i[e]="function"===u?r(n[e]):r&&"object"===u?zu(r,n[e]):n[e];return i}),Nt=B(M(["find"],Y,function(t,n){for(var r=0,e=n.length;e>r;){if(t(n[r]))return n[r];r+=1}})),It=B(M([],Z,function(t,n){for(var r=0,e=n.length;e>r;){if(t(n[r]))return r;r+=1}return-1})),qt=B(M([],G,function(t,n){for(var r=n.length-1;r>=0;){if(t(n[r]))return n[r];r-=1}})),Wt=B(M([],J,function(t,n){for(var r=n.length-1;r>=0;){if(t(n[r]))return r;r-=1}return-1})),Ct=B(T("forEach",function(t,n){for(var r=n.length,e=0;r>e;)t(n[e]),e+=1;return n})),Pt=F(function(t){for(var n={},r=0;r<t.length;)n[t[r][0]]=t[r][1],r+=1;return n}),Tt=B(function(t,n){for(var r=[],e=0,u=n.length;u>e;){for(var i=e+1;u>i&&t(n[e],n[i]);)i+=1;r.push(n.slice(e,i)),e=i}return r}),Ft=B(function(t,n){return t>n}),Bt=B(function(t,n){return t>=n}),Ut=B(p),Rt=B(function(t,n){return t in n}),Mt=B(function(t,n){return t===n?0!==t||1/t===1/n:t!==t&&n!==n}),Lt=F(h),Dt=U(function(t,n,r){return vt(Math.max(t.length,n.length,r.length),function(){return t.apply(this,arguments)?n.apply(this,arguments):r.apply(this,arguments)})}),zt=et(1),Vt=U(function(t,n,r){t=t<r.length&&t>=0?t:r.length;var e=Array.prototype.slice.call(r,0);return e.splice(t,0,n),e}),Kt=U(function(t,n,r){return t=t<r.length&&t>=0?t:r.length,[].concat(Array.prototype.slice.call(r,0,t),n,Array.prototype.slice.call(r,t))}),$t=B(T("intersperse",function(t,n){for(var r=[],e=0,u=n.length;u>e;)e===u-1?r.push(n[e]):r.push(n[e],t),e+=1;return r})),Ht=B(function(t,n){return null!=n&&n.constructor===t||n instanceof t}),Xt=F(function(t){return y(t)?!0:t?"object"!=typeof t?!1:A(t)?!1:1===t.nodeType?!!t.length:0===t.length?!0:t.length>0?t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1):!1:!1}),Yt=F(function(t){return null==t}),Zt=function(){var t=!{toString:null}.propertyIsEnumerable("toString"),n=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],r=function(){return arguments.propertyIsEnumerable("length")}(),e=function(t,n){for(var r=0;r<t.length;){if(t[r]===n)return!0;r+=1}return!1};return F("function"!=typeof Object.keys||r?function(u){if(Object(u)!==u)return[];var i,o,c=[],a=r&&g(u);for(i in u)!p(i,u)||a&&"length"===i||(c[c.length]=i);if(t)for(o=n.length-1;o>=0;)i=n[o],p(i,u)&&!e(c,i)&&(c[c.length]=i),o-=1;return c}:function(t){return Object(t)!==t?[]:Object.keys(t)})}(),Gt=F(function(t){var n,r=[];for(n in t)r[r.length]=n;return r}),Jt=F(function(t){return null!=t&&v(t.length)?t.length:NaN}),Qt=B(function(t,n){return n>t}),tn=B(function(t,n){return n>=t}),nn=U(function(t,n,r){for(var e=0,u=r.length,i=[],o=[n];u>e;)o=t(o[0],r[e]),i[e]=o[1],e+=1;return[o[0],i]}),rn=U(function(t,n,r){for(var e=r.length-1,u=[],i=[n];e>=0;)i=t(r[e],i[0]),u[e]=i[1],e-=1;return[u,i[0]]}),en=B(function(t,n){return n.match(t)||[]}),un=B(function(t,n){return m(t)?!m(n)||1>n?NaN:(t%n+n)%n:NaN}),on=B(function(t,n){return n>t?n:t}),cn=U(function(t,n,r){return t(r)>t(n)?r:n}),an=B(function(t,n){return P({},t,n)}),sn=F(function(t){return P.apply(null,[{}].concat(t))}),fn=U(function(t,n,r){var e,u={};for(e in n)p(e,n)&&(u[e]=p(e,r)?t(e,n[e],r[e]):n[e]);for(e in r)p(e,r)&&!p(e,u)&&(u[e]=r[e]);return u}),ln=B(function(t,n){return t>n?n:t}),pn=U(function(t,n,r){return t(r)<t(n)?r:n}),hn=B(function(t,n){return t%n}),gn=B(function(t,n){return t*n}),yn=B(function(t,n){switch(t){case 0:return function(){return n.call(this)};case 1:return function(t){return n.call(this,t)};case 2:return function(t,r){return n.call(this,t,r)};case 3:return function(t,r,e){return n.call(this,t,r,e)};case 4:return function(t,r,e,u){return n.call(this,t,r,e,u)};case 5:return function(t,r,e,u,i){return n.call(this,t,r,e,u,i)};case 6:return function(t,r,e,u,i,o){return n.call(this,t,r,e,u,i,o)};case 7:return function(t,r,e,u,i,o,c){return n.call(this,t,r,e,u,i,o,c)};case 8:return function(t,r,e,u,i,o,c,a){return n.call(this,t,r,e,u,i,o,c,a)};case 9:return function(t,r,e,u,i,o,c,a,s){return n.call(this,t,r,e,u,i,o,c,a,s)};case 10:return function(t,r,e,u,i,o,c,a,s,f){return n.call(this,t,r,e,u,i,o,c,a,s,f)};default:throw new Error("First argument to nAry must be a non-negative integer no greater than ten")}}),dn=F(function(t){return-t}),mn=B(i(M(["any"],D,at))),vn=F(function(t){return!t}),wn=B(function(t,n){var r=0>t?n.length+t:t;return A(n)?n.charAt(r):n[r]}),bn=F(function(t){var n=0>t?1:t+1;return vt(n,function(){return wn(t,arguments)})}),xn=B(function(t,n){var r={};return r[t]=n,r}),An=F(E),jn=F(function(t){var n,e=!1;return r(t.length,function(){return e?n:(e=!0,n=t.apply(this,arguments))})}),On=B(function(t,n){return t||n}),Sn=function(){var t=function(n){return{value:n,map:function(r){return t(r(n))}}};return U(function(n,r,e){return n(function(n){return t(r(n))})(e).value})}(),En=B(function(t,n){return[t,n]}),_n=B(function(t,n){for(var r=n,e=0;e<t.length;){if(null==r)return;r=r[t[e]],e+=1}return r}),kn=U(function(t,n,r){return bt(t,_n(n,r))}),Nn=U(function(t,n,r){return n.length>0&&t(_n(n,r))}),In=B(function(t,n){for(var r={},e=0;e<t.length;)t[e]in n&&(r[t[e]]=n[t[e]]),e+=1;return r}),qn=B(function(t,n){for(var r={},e=0,u=t.length;u>e;){var i=t[e];r[i]=n[i],e+=1}return r}),Wn=B(function(t,n){var r={};for(var e in n)t(n[e],e,n)&&(r[e]=n[e]);return r}),Cn=B(function(t,n){return o([t],n)}),Pn=B(function(t,n){return n[t]}),Tn=U(function(t,n,r){return Ht(t,r[n])}),Fn=U(function(t,n,r){return null!=r&&p(n,r)?r[n]:t}),Bn=U(function(t,n,r){return t(r[n])}),Un=B(function(t,n){for(var r=t.length,e=[],u=0;r>u;)e[u]=n[t[u]],u+=1;return e}),Rn=B(function(t,n){if(!v(t)||!v(n))throw new TypeError("Both arguments to range must be numbers");for(var r=[],e=t;n>e;)r.push(e),e+=1;return r}),Mn=U(function(t,n,r){for(var e=r.length-1;e>=0;)n=t(r[e],n),e-=1;return n}),Ln=F(I),Dn=U(function(t,n,r){var e=Array.prototype.slice.call(r,0);return e.splice(t,n),e}),zn=U(function(t,n,r){return r.replace(t,n)}),Vn=F(function(t){return A(t)?t.split("").reverse().join(""):Array.prototype.slice.call(t,0).reverse()}),Kn=U(function(t,n,r){for(var e=0,u=r.length,i=[n];u>e;)n=t(n,r[e]),i[e+1]=n,e+=1;return i}),$n=U(function(t,n,r){return Sn(t,ot(n),r)}),Hn=U(T("slice",function(t,n,r){return Array.prototype.slice.call(r,t,n)})),Xn=B(function(t,n){return Array.prototype.slice.call(n,0).sort(t)}),Yn=B(function(t,n){return Array.prototype.slice.call(n,0).sort(function(n,r){var e=t(n),u=t(r);return u>e?-1:e>u?1:0})}),Zn=B(function(t,n){return Array.prototype.slice.call(n,0).sort(function(n,r){for(var e=0,u=0;0===e&&u<t.length;)e=t[u](n,r),u+=1;return e})}),Gn=B(function(t,n){return[Hn(0,t,n),Hn(t,Jt(n),n)]}),Jn=B(function(t,n){if(0>=t)throw new Error("First argument to splitEvery must be a positive integer");for(var r=[],e=0;e<n.length;)r.push(Hn(e,e+=t,n));return r}),Qn=B(function(t,n){for(var r=0,e=n.length,u=[];e>r&&!t(n[r]);)u.push(n[r]),r+=1;return[u,Array.prototype.slice.call(n,r)]}),tr=B(function(t,n){return Number(t)-Number(n)}),nr=F(T("tail",Hn(1,1/0))),rr=B(M(["take"],nt,function(t,n){return Hn(0,0>t?1/0:t,n)})),er=B(function(t,n){for(var r=n.length-1;r>=0&&t(n[r]);)r-=1;return Array.prototype.slice.call(n,r+1)}),ur=B(M(["takeWhile"],rt,function(t,n){for(var r=0,e=n.length;e>r&&t(n[r]);)r+=1;return Array.prototype.slice.call(n,0,r)})),ir=B(function(t,n){return t(n),n}),or=B(function(t,n){var r,e=Number(n),u=0;if(0>e||isNaN(e))throw new RangeError("n must be a non-negative number");for(r=new Array(e);e>u;)r[u]=t(u),u+=1;return r}),cr=F(function(t){var n=[];for(var r in t)p(r,t)&&(n[n.length]=[r,t[r]]);return n}),ar=F(function(t){var n=[];for(var r in t)n[n.length]=[r,t[r]];return n}),sr=F(function(t){for(var n=0,r=[];n<t.length;){for(var e=t[n],u=0;u<e.length;)"undefined"==typeof r[u]&&(r[u]=[]),r[u].push(e[u]),u+=1;n+=1}return r}),fr=function(){var t="	\n\f\r   ᠎             　\u2028\u2029\ufeff",n="​",r="function"==typeof String.prototype.trim;return F(r&&!t.trim()&&n.trim()?function(t){return t.trim()}:function(n){var r=new RegExp("^["+t+"]["+t+"]*"),e=new RegExp("["+t+"]["+t+"]*$");return n.replace(r,"").replace(e,"")})}(),lr=B(function(t,n){return r(t.length,function(){try{return t.apply(this,arguments)}catch(r){return n.apply(this,o([r],arguments))}})}),pr=F(function(t){return null===t?"Null":void 0===t?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}),hr=F(function(t){return function(){return t(Array.prototype.slice.call(arguments,0))}}),gr=F(function(t){return yn(1,t)}),yr=B(function(t,n){return vt(t,function(){for(var r,e=1,u=n,i=0;t>=e&&"function"==typeof u;)r=e===t?arguments.length:i+u.length,u=u.apply(this,Array.prototype.slice.call(arguments,i,r)),e+=1,i=r;return u})}),dr=B(function(t,n){for(var r=t(n),e=[];r&&r.length;)e[e.length]=r[0],r=t(r[1]);return e}),mr=B(function(t,n){for(var r,e=0,u=n.length,i=[];u>e;)r=n[e],c(t,r,i)||(i[i.length]=r),e+=1;return i}),vr=U(function(t,n,r){return t(r)?r:n(r)}),wr=U(function(t,n,r){for(var e=r;!t(e);)e=n(e);return e}),br=U(function(t,n,r){return ut(ot(n),t,r)}),xr=B(function(t,n){return vt(n.length,function(){for(var r=[],e=0;e<n.length;)r.push(n[e].call(this,arguments[e])),e+=1;return t.apply(this,r.concat(Array.prototype.slice.call(arguments,n.length)))})}),Ar=F(function(t){for(var n=Zt(t),r=n.length,e=[],u=0;r>u;)e[u]=t[n[u]],u+=1;return e}),jr=F(function(t){var n,r=[];for(n in t)r[r.length]=t[n];return r}),Or=function(){var t=function(t){return{value:t,map:function(){return this}}};return B(function(n,r){return n(t)(r).value})}(),Sr=U(function(t,n,r){return t(r)?n(r):r}),Er=B(function(t,n){for(var r in t)if(p(r,t)&&!t[r](n[r]))return!1;return!0}),_r=B(function(t,n){for(var r,e=0,u=t.length,i=n.length,o=[];u>e;){for(r=0;i>r;)o[o.length]=[t[e],n[r]],r+=1;e+=1}return o}),kr=B(function(t,n){for(var r=[],e=0,u=Math.min(t.length,n.length);u>e;)r[e]=[t[e],n[e]],e+=1;return r}),Nr=B(function(t,n){for(var r=0,e=Math.min(t.length,n.length),u={};e>r;)u[t[r]]=n[r],r+=1;return u}),Ir=U(function(t,n,r){for(var e=[],u=0,i=Math.min(n.length,r.length);i>u;)e[u]=t(n[u],r[u]),u+=1;return e}),qr=ot(!1),Wr=ot(!0),Cr=function Vu(t,n,r,e){var i=function(u){for(var i=n.length,o=0;i>o;){if(t===n[o])return r[o];o+=1}n[o+1]=t,r[o+1]=u;for(var c in t)u[c]=e?Vu(t[c],n,r,!0):t[c];return u};switch(pr(t)){case"Object":return i({});case"Array":return i([]);case"Date":return new Date(t.valueOf());case"RegExp":return u(t);default:return t}},Pr=function(t){return B(function(n,e){return r(Math.max(0,n.length-e.length),function(){return n.apply(this,t(e,arguments))})})},Tr=function(t,n){return rr(t<n.length?n.length-t:0,n)},Fr=function Ku(t,n,r,u){if(Mt(t,n))return!0;if(pr(t)!==pr(n))return!1;if(null==t||null==n)return!1;if("function"==typeof t.equals||"function"==typeof n.equals)return"function"==typeof t.equals&&t.equals(n)&&"function"==typeof n.equals&&n.equals(t);switch(pr(t)){case"Arguments":case"Array":case"Object":if("function"==typeof t.constructor&&"Promise"===l(t.constructor))return t===n;break;case"Boolean":case"Number":case"String":if(typeof t!=typeof n||!Mt(t.valueOf(),n.valueOf()))return!1;break;case"Date":if(!Mt(t.valueOf(),n.valueOf()))return!1;break;case"Error":return t.name===n.name&&t.message===n.message;case"RegExp":if(t.source!==n.source||t.global!==n.global||t.ignoreCase!==n.ignoreCase||t.multiline!==n.multiline||t.sticky!==n.sticky||t.unicode!==n.unicode)return!1;break;case"Map":case"Set":if(!Ku(e(t.entries()),e(n.entries()),r,u))return!1;break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":break;case"ArrayBuffer":break;default:return!1}var i=Zt(t);if(i.length!==Zt(n).length)return!1;for(var o=r.length-1;o>=0;){if(r[o]===t)return u[o]===n;o-=1}for(r.push(t),u.push(n),o=i.length-1;o>=0;){var c=i[o];if(!p(c,n)||!Ku(n[c],t[c],r,u))return!1;o-=1}return r.pop(),u.pop(),!0},Br=function(t){return function n(r){for(var e,u,i,o=[],c=0,a=r.length;a>c;){if(Xt(r[c]))for(e=t?n(r[c]):r[c],i=0,u=e.length;u>i;)o[o.length]=e[i],i+=1;else o[o.length]=r[c];c+=1}return o}},Ur=function(){function t(t,n,r){for(var e=0,u=r.length;u>e;){if(n=t["@@transducer/step"](n,r[e]),n&&n["@@transducer/reduced"]){n=n["@@transducer/value"];break}e+=1}return t["@@transducer/result"](n)}function n(t,n,r){for(var e=r.next();!e.done;){if(n=t["@@transducer/step"](n,e.value),n&&n["@@transducer/reduced"]){n=n["@@transducer/value"];break}e=r.next()}return t["@@transducer/result"](n)}function r(t,n,r){return t["@@transducer/result"](r.reduce(yt(t["@@transducer/step"],t),n))}var e="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";return function(u,i,o){if("function"==typeof u&&(u=C(u)),Xt(o))return t(u,i,o);if("function"==typeof o.reduce)return r(u,i,o);if(null!=o[e])return n(u,i,o[e]());if("function"==typeof o.next)return n(u,i,o);throw new TypeError("reduce: list must be array or iterable")}}(),Rr=function(){var t={"@@transducer/init":Array,"@@transducer/step":function(t,n){return t.push(n),t},"@@transducer/result":h},n={"@@transducer/init":String,"@@transducer/step":function(t,n){return t+n},"@@transducer/result":h},r={"@@transducer/init":Object,"@@transducer/step":function(t,n){return P(t,Xt(n)?xn(n[0],n[1]):n)},"@@transducer/result":h};return function(e){if(j(e))return e;if(Xt(e))return t;if("string"==typeof e)return n;if("object"==typeof e)return r;throw new Error("Cannot create transformer for "+e)}}(),Mr=function(){function t(t,n){this.f=t,this.retained=[],this.xf=n}return t.prototype["@@transducer/init"]=W.init,t.prototype["@@transducer/result"]=function(t){return this.retained=null,this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,n){return this.f(n)?this.retain(t,n):this.flush(t,n)},t.prototype.flush=function(t,n){return t=Ur(this.xf["@@transducer/step"],t,this.retained),this.retained=[],this.xf["@@transducer/step"](t,n)},t.prototype.retain=function(t,n){return this.retained.push(n),t},B(function(n,r){return new t(n,r)})}(),Lr=F(function(t){return vt(t.length,function(){var n=0,r=arguments[0],e=arguments[arguments.length-1],u=Array.prototype.slice.call(arguments,0);return u[0]=function(){var t=r.apply(this,o(arguments,[n,e]));return n+=1,t},t.apply(this,u)})}),Dr=F(function(t){return yn(2,t)}),zr=F(function(t){return null!=t&&"function"==typeof t.clone?t.clone():Cr(t,[],[],!0)}),Vr=F(function(t){return vt(t.length,t)}),Kr=B(M(["drop"],V,function(t,n){return Hn(Math.max(0,t),1/0,n)})),$r=B(M([],K,Tr)),Hr=B(M([],Mr,a)),Xr=B(function(t,n){return Fr(t,n,[],[])}),Yr=B(M(["filter"],X,function(t,n){return w(n)?Ur(function(r,e){return t(n[e])&&(r[e]=n[e]),r},{},Zt(n)):s(t,n)})),Zr=F(Br(!0)),Gr=F(function(t){return Vr(function(n,r){var e=Array.prototype.slice.call(arguments,0);return e[0]=r,e[1]=n,t.apply(this,e)})}),Jr=B(function(t,n){for(var r=Zt(n),e=0;e<r.length;){var u=r[e];t(n[u],u,n),e+=1}return n}),Qr=wn(0),te=Hn(0,-1),ne=U(function(t,n,r){var e,u;n.length>r.length?(e=n,u=r):(e=r,u=n);for(var i=[],o=0;o<u.length;)c(t,u[o],e)&&(i[i.length]=u[o]),o+=1;return mr(t,i)}),re=U(function(t,n,r){return j(t)?Ur(n(t),t["@@transducer/init"](),r):Ur(n(Rr(t)),Cr(t,[],[],!1),r)}),ee=F(function(t){for(var n=Zt(t),r=n.length,e=0,u={};r>e;){var i=n[e],o=t[i],c=p(o,u)?u[o]:u[o]=[];c[c.length]=i,e+=1}return u}),ue=F(function(t){for(var n=Zt(t),r=n.length,e=0,u={};r>e;){var i=n[e];u[t[i]]=i,e+=1}return u}),ie=F(function(t){return null!=t&&Xr(t,_t(t))}),oe=wn(-1),ce=B(function(t,n){if("function"!=typeof n.lastIndexOf||y(n)){for(var r=n.length-1;r>=0;){if(Xr(n[r],t))return r;r-=1}return-1}return n.lastIndexOf(t)}),ae=B(M(["map"],Q,function(t,n){switch(Object.prototype.toString.call(n)){case"[object Function]":return vt(n.length,function(){return t.call(this,n.apply(this,arguments))});case"[object Object]":return Ur(function(r,e){return r[e]=t(n[e]),r},{},Zt(n));default:return O(t,n)}})),se=B(function(t,n){return Ur(function(r,e){return r[e]=t(n[e],e,n),r},{},Zt(n))}),fe=U(function(t,n,r){return fn(function(n,r,e){return t(r,e)},n,r)}),le=Pr(o),pe=Pr(Gr(o)),he=U(function(t,n,r){return Xr(_n(t,r),n)}),ge=B(function(t,n){return ae(Pn(t),n)}),ye=xr(O,[qn,Lt]),de=U(function(t,n,r){return Xr(n,r[t])}),me=U(Ur),ve=R(4,[],M([],tt,function(t,n,r,e){return Ur(function(e,u){var i=r(u);return e[i]=t(p(i,e)?e[i]:n,u),e},{},e)})),we=R(4,[],function(t,n,r,e){return Ur(function(r,e){return t(r,e)?n(r,e):I(r)},r,e)}),be=B(function(t,n){return Yr(i(t),n)}),xe=B(function(t,n){return or(ot(t),n)}),Ae=me(et,0),je=B(function(t,n){return Kr(t>=0?n.length-t:0,n)}),Oe=vt(4,function(t,n,r,e){return Ur(t("function"==typeof n?C(n):n),r,e)}),Se=U(function(t,n,r){return mr(t,o(n,r))}),Ee=B(function(t,n){return Er(ae(Xr,t),n)}),_e=function(){var t=function(t){return{"@@transducer/init":W.init,"@@transducer/result":function(n){return t["@@transducer/result"](n)},"@@transducer/step":function(n,r){var e=t["@@transducer/step"](n,r);return e["@@transducer/reduced"]?f(e):e}}};return function(n){var r=t(n);return{"@@transducer/init":W.init,"@@transducer/result":function(t){return r["@@transducer/result"](t)},"@@transducer/step":function(t,n){return Xt(n)?Ur(r,t,n):Ur(r,t,[n])}}}}(),ke=function(t,n,r){var e,u;if("function"==typeof t.indexOf)switch(typeof n){case"number":if(0===n){for(e=1/n;r<t.length;){if(u=t[r],0===u&&1/u===e)return r;
r+=1}return-1}if(n!==n){for(;r<t.length;){if(u=t[r],"number"==typeof u&&u!==u)return r;r+=1}return-1}return t.indexOf(n,r);case"string":case"boolean":case"function":case"undefined":return t.indexOf(n,r);case"object":if(null===n)return t.indexOf(n,r)}for(;r<t.length;){if(Xr(t[r],n))return r;r+=1}return-1},Ne=B(function(t,n){return ae(t,_e(n))}),Ie=F(function(t){return vt(me(on,0,ge("length",t)),function(){for(var n=0,r=t.length;r>n;){if(!t[n].apply(this,arguments))return!1;n+=1}return!0})}),qe=F(function(t){return vt(me(on,0,ge("length",t)),function(){for(var n=0,r=t.length;r>n;){if(t[n].apply(this,arguments))return!0;n+=1}return!1})}),We=B(function(t,n){return"function"==typeof t.ap?t.ap(n):"function"==typeof t?function(r){return t(r)(n(r))}:Ur(function(t,r){return o(t,ae(r,n))},[],t)}),Ce=F(function $u(t){return t=ae(function(t){return"function"==typeof t?t:$u(t)},t),vt(me(on,0,ge("length",Ar(t))),function(){var n=arguments;return ae(function(t){return lt(t,n)},t)})}),Pe=Vr(function(t){return t.apply(this,Array.prototype.slice.call(arguments,1))}),Te=B(M(["chain"],Ne,function(t,n){return"function"==typeof n?function(r){return t(n(r))(r)}:Br(!1)(ae(t,n))})),Fe=F(function(t){var n=me(on,0,ae(function(t){return t[0].length},t));return r(n,function(){for(var n=0;n<t.length;){if(t[n][0].apply(this,arguments))return t[n][1].apply(this,arguments);n+=1}})}),Be=B(function(t,n){if(t>10)throw new Error("Constructor with greater than ten arguments");return 0===t?function(){return new n}:Vr(yn(t,function(t,r,e,u,i,o,c,a,s,f){switch(arguments.length){case 1:return new n(t);case 2:return new n(t,r);case 3:return new n(t,r,e);case 4:return new n(t,r,e,u);case 5:return new n(t,r,e,u,i);case 6:return new n(t,r,e,u,i,o);case 7:return new n(t,r,e,u,i,o,c);case 8:return new n(t,r,e,u,i,o,c,a);case 9:return new n(t,r,e,u,i,o,c,a,s);case 10:return new n(t,r,e,u,i,o,c,a,s,f)}}))}),Ue=B(function(t,n){return vt(me(on,0,ge("length",n)),function(){var r=arguments,e=this;return t.apply(e,O(function(t){return t.apply(e,r)},n))})}),Re=ve(function(t,n){return t+1},0),Me=B(M([],$,function(t,n){var r=[],e=1,u=n.length;if(0!==u)for(r[0]=n[0];u>e;)t(oe(r),n[e])||(r[r.length]=n[e]),e+=1;return r})),Le=U(function(t,n,r){return Xr(t(n),t(r))}),De=U(function(t,n,r){return Xr(n[t],r[t])}),ze=B(T("groupBy",ve(function(t,n){return null==t&&(t=[]),t.push(n),t},null))),Ve=ve(function(t,n){return n},null),Ke=B(function(t,n){return"function"!=typeof n.indexOf||y(n)?ke(n,t,0):n.indexOf(t)}),$e=F(function(t){return Ue(function(){return Array.prototype.slice.call(arguments,0)},t)}),He=B(function(t,n){return function(r){return function(e){return ae(function(t){return n(t,e)},r(t(e)))}}}),Xe=F(function(t){return He(wn(t),br(t))}),Ye=F(function(t){return He(_n(t),gt(t))}),Ze=F(function(t){return He(Pn(t),ht(t))}),Ge=B(function(t,n){var r=vt(t,n);return vt(t,function(){return Ur(We,ae(r,arguments[0]),Array.prototype.slice.call(arguments,1))})}),Je=F(function(t){return Ae(t)/t.length}),Qe=F(function(t){var n=t.length;if(0===n)return NaN;var r=2-n%2,e=(n-r)/2;return Je(Array.prototype.slice.call(t,0).sort(function(t,n){return n>t?-1:t>n?1:0}).slice(e,e+r))}),tu=$e([Yr,be]),nu=function(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return r(arguments[0].length,me(_,arguments[0],nr(arguments)))},ru=function(){if(0===arguments.length)throw new Error("pipeP requires at least one argument");return r(arguments[0].length,me(k,arguments[0],nr(arguments)))},eu=me(gn,1),uu=B(function(t,n){return"function"==typeof n.sequence?n.sequence(t):Mn(function(t,n){return We(ae(Cn,t),n)},t([]),n)}),iu=U(function(t,n,r){return uu(t,ae(n,r))}),ou=Te(h),cu=function(t,n){return ke(n,t,0)>=0},au=function Hu(t,n){var r=function(r){var e=n.concat([t]);return cu(r,e)?"<Circular>":Hu(r,e)},e=function(t,n){return O(function(n){return N(n)+": "+r(t[n])},n.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+O(r,t).join(", ")+"))";case"[object Array]":return"["+O(r,t).concat(e(t,be(function(t){return/^\d+$/.test(t)},Zt(t)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof t?"new Boolean("+r(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?r(NaN):N(q(t)))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof t?"new Number("+r(t.valueOf())+")":1/t===-(1/0)?"-0":t.toString(10);case"[object String]":return"object"==typeof t?"new String("+r(t.valueOf())+")":N(t);case"[object Undefined]":return"undefined";default:if("function"==typeof t.toString){var u=t.toString();if("[object Object]"!==u)return u}return"{"+e(t,Zt(t)).join(", ")+"}"}},su=function(){if(0===arguments.length)throw new Error("compose requires at least one argument");return nu.apply(this,Vn(arguments))},fu=function(){if(0===arguments.length)throw new Error("composeK requires at least one argument");var t=Array.prototype.slice.call(arguments),n=t.pop();return su(su.apply(this,ae(Te,t)),n)},lu=function(){if(0===arguments.length)throw new Error("composeP requires at least one argument");return ru.apply(this,Vn(arguments))},pu=F(function(t){return Be(t.length,t)}),hu=B(cu),gu=B(function(t,n){for(var r=[],e=0,u=t.length;u>e;)cu(t[e],n)||cu(t[e],r)||(r[r.length]=t[e]),e+=1;return r}),yu=F(M([],$(Xr),Me(Xr))),du=F(function(t){return Ge(t.length,t)}),mu=B(function(t,n){var r={};for(var e in n)cu(e,t)||(r[e]=n[e]);return r}),vu=function(){if(0===arguments.length)throw new Error("pipeK requires at least one argument");return fu.apply(this,Vn(arguments))},wu=F(function(t){return au(t,[])}),bu=B(function(t,n){return be(Gr(cu)(t),n)}),xu=function(){function t(){this._nativeSet="function"==typeof Set?new Set:null,this._items={}}function n(t,n,r){var e,u,i=typeof t;switch(i){case"string":case"number":return 0===t&&1/t===-(1/0)?r._items["-0"]?!0:(n&&(r._items["-0"]=!0),!1):null!==r._nativeSet?n?(e=r._nativeSet.size,r._nativeSet.add(t),u=r._nativeSet.size,u===e):r._nativeSet.has(t):i in r._items?t in r._items[i]?!0:(n&&(r._items[i][t]=!0),!1):(n&&(r._items[i]={},r._items[i][t]=!0),!1);case"boolean":if(i in r._items){var o=t?1:0;return r._items[i][o]?!0:(n&&(r._items[i][o]=!0),!1)}return n&&(r._items[i]=t?[!1,!0]:[!0,!1]),!1;case"function":return null!==r._nativeSet?n?(e=r._nativeSet.size,r._nativeSet.add(t),u=r._nativeSet.size,u===e):r._nativeSet.has(t):i in r._items?cu(t,r._items[i])?!0:(n&&r._items[i].push(t),!1):(n&&(r._items[i]=[t]),!1);case"undefined":return r._items[i]?!0:(n&&(r._items[i]=!0),!1);case"object":if(null===t)return r._items["null"]?!0:(n&&(r._items["null"]=!0),!1);default:return i=Object.prototype.toString.call(t),i in r._items?cu(t,r._items[i])?!0:(n&&r._items[i].push(t),!1):(n&&(r._items[i]=[t]),!1)}}return t.prototype.add=function(t){return!n(t,!0,this)},t.prototype.has=function(t){return n(t,!1,this)},t}(),Au=B(function(t,n){return d(t)?function(){return t.apply(this,arguments)&&n.apply(this,arguments)}:du(ct)(t,n)}),ju=du(vn),Ou=B(function(t,n){if(null==t||!d(t.concat))throw new TypeError(wu(t)+' does not have a method named "concat"');if(y(t)&&!y(n))throw new TypeError(wu(n)+" is not an array");return t.concat(n)}),Su=B(function(t,n){return d(t)?function(){return t.apply(this,arguments)||n.apply(this,arguments)}:du(On)(t,n)}),Eu=B(function(t,n){return vt(t+1,function(){var r=arguments[t];if(null!=r&&d(r[n]))return r[n].apply(r,Array.prototype.slice.call(arguments,0,t));throw new TypeError(wu(r)+' does not have a method named "'+n+'"')})}),_u=Eu(1,"join"),ku=F(function(t){var n={};return r(t.length,function(){var r=wu(arguments);return p(r,n)||(n[r]=t.apply(this,arguments)),n[r]})}),Nu=Eu(1,"split"),Iu=B(function(t,n){return Ou(gu(t,n),gu(n,t))}),qu=U(function(t,n,r){return Ou(At(t,n,r),At(t,r,n))}),Wu=B(function(t,n){if(!x(t))throw new TypeError("‘test’ requires a value of type RegExp as its first argument; received "+wu(t));return u(t).test(n)}),Cu=Eu(0,"toLowerCase"),Pu=Eu(0,"toUpperCase"),Tu=B(function(t,n){for(var r,e,u=new xu,i=[],o=0;o<n.length;)e=n[o],r=t(e),u.add(r)&&i.push(e),o+=1;return i}),Fu=Tu(Lt),Bu=B(function(t,n){var r,e;return t.length>n.length?(r=t,e=n):(r=n,e=t),Fu(s(Gr(cu)(r),e))}),Uu=B(su(Fu,o)),Ru={F:qr,T:Wr,__:t,add:et,addIndex:Lr,adjust:ut,all:it,allPass:Ie,always:ot,and:ct,any:at,anyPass:qe,ap:We,aperture:st,append:ft,apply:lt,applySpec:Ce,ascend:pt,assoc:ht,assocPath:gt,binary:Dr,bind:yt,both:Au,call:Pe,chain:Te,clamp:dt,clone:zr,comparator:mt,complement:ju,compose:su,composeK:fu,composeP:lu,concat:Ou,cond:Fe,construct:pu,constructN:Be,contains:hu,converge:Ue,countBy:Re,curry:Vr,curryN:vt,dec:wt,defaultTo:bt,descend:xt,difference:gu,differenceWith:At,dissoc:jt,dissocPath:Ot,divide:St,drop:Kr,dropLast:$r,dropLastWhile:Hr,dropRepeats:yu,dropRepeatsWith:Me,dropWhile:Et,either:Su,empty:_t,eqBy:Le,eqProps:De,equals:Xr,evolve:kt,filter:Yr,find:Nt,findIndex:It,findLast:qt,findLastIndex:Wt,flatten:Zr,flip:Gr,forEach:Ct,forEachObjIndexed:Jr,fromPairs:Pt,groupBy:ze,groupWith:Tt,gt:Ft,gte:Bt,has:Ut,hasIn:Rt,head:Qr,identical:Mt,identity:Lt,ifElse:Dt,inc:zt,indexBy:Ve,indexOf:Ke,init:te,insert:Vt,insertAll:Kt,intersection:Bu,intersectionWith:ne,intersperse:$t,into:re,invert:ee,invertObj:ue,invoker:Eu,is:Ht,isArrayLike:Xt,isEmpty:ie,isNil:Yt,join:_u,juxt:$e,keys:Zt,keysIn:Gt,last:oe,lastIndexOf:ce,length:Jt,lens:He,lensIndex:Xe,lensPath:Ye,lensProp:Ze,lift:du,liftN:Ge,lt:Qt,lte:tn,map:ae,mapAccum:nn,mapAccumRight:rn,mapObjIndexed:se,match:en,mathMod:un,max:on,maxBy:cn,mean:Je,median:Qe,memoize:ku,merge:an,mergeAll:sn,mergeWith:fe,mergeWithKey:fn,min:ln,minBy:pn,modulo:hn,multiply:gn,nAry:yn,negate:dn,none:mn,not:vn,nth:wn,nthArg:bn,objOf:xn,of:An,omit:mu,once:jn,or:On,over:Sn,pair:En,partial:le,partialRight:pe,partition:tu,path:_n,pathEq:he,pathOr:kn,pathSatisfies:Nn,pick:In,pickAll:qn,pickBy:Wn,pipe:nu,pipeK:vu,pipeP:ru,pluck:ge,prepend:Cn,product:eu,project:ye,prop:Pn,propEq:de,propIs:Tn,propOr:Fn,propSatisfies:Bn,props:Un,range:Rn,reduce:me,reduceBy:ve,reduceRight:Mn,reduceWhile:we,reduced:Ln,reject:be,remove:Dn,repeat:xe,replace:zn,reverse:Vn,scan:Kn,sequence:uu,set:$n,slice:Hn,sort:Xn,sortBy:Yn,sortWith:Zn,split:Nu,splitAt:Gn,splitEvery:Jn,splitWhen:Qn,subtract:tr,sum:Ae,symmetricDifference:Iu,symmetricDifferenceWith:qu,tail:nr,take:rr,takeLast:je,takeLastWhile:er,takeWhile:ur,tap:ir,test:Wu,times:or,toLower:Cu,toPairs:cr,toPairsIn:ar,toString:wu,toUpper:Pu,transduce:Oe,transpose:sr,traverse:iu,trim:fr,tryCatch:lr,type:pr,unapply:hr,unary:gr,uncurryN:yr,unfold:dr,union:Uu,unionWith:Se,uniq:Fu,uniqBy:Tu,uniqWith:mr,unless:vr,unnest:ou,until:wr,update:br,useWith:xr,values:Ar,valuesIn:jr,view:Or,when:Sr,where:Er,whereEq:Ee,without:bu,xprod:_r,zip:kr,zipObj:Nr,zipWith:Ir};"object"==typeof exports?module.exports=Ru:"function"==typeof define&&define.amd?define(function(){return Ru}):this.R=Ru}).call(this);


/* end /scripts/libs/ramda-0.23.0.min.js*/

/* start /scripts/libs/jquery/plugins/typeahead-bloodhound.min.js*/
/*!
 * typeahead.js 0.11.1
 * https://github.com/twitter/typeahead.js
 * Copyright 2013-2015 Twitter, Inc. and other contributors; Licensed MIT
 */

!function(a,b){"function"==typeof define&&define.amd?define("bloodhound",["jquery"],function(c){return a.Bloodhound=b(c)}):"object"==typeof exports?module.exports=b(require("jquery")):a.Bloodhound=b(jQuery)}(this,function(a){var b=function(){"use strict";return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(a){return!a||/^\s*$/.test(a)},escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(a){return"string"==typeof a},isNumber:function(a){return"number"==typeof a},isArray:a.isArray,isFunction:a.isFunction,isObject:a.isPlainObject,isUndefined:function(a){return"undefined"==typeof a},isElement:function(a){return!(!a||1!==a.nodeType)},isJQuery:function(b){return b instanceof a},toStr:function(a){return b.isUndefined(a)||null===a?"":a+""},bind:a.proxy,each:function(b,c){function d(a,b){return c(b,a)}a.each(b,d)},map:a.map,filter:a.grep,every:function(b,c){var d=!0;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?void 0:!1}),!!d):d},some:function(b,c){var d=!1;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?!1:void 0}),!!d):d},mixin:a.extend,identity:function(a){return a},clone:function(b){return a.extend(!0,{},b)},getIdGenerator:function(){var a=0;return function(){return a++}},templatify:function(b){function c(){return String(b)}return a.isFunction(b)?b:c},defer:function(a){setTimeout(a,0)},debounce:function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return f=function(){d=null,c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},throttle:function(a,b){var c,d,e,f,g,h;return g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)},function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},stringify:function(a){return b.isString(a)?a:JSON.stringify(a)},noop:function(){}}}(),c="0.11.1",d=function(){"use strict";function a(a){return a=b.toStr(a),a?a.split(/\s+/):[]}function c(a){return a=b.toStr(a),a?a.split(/\W+/):[]}function d(a){return function(c){return c=b.isArray(c)?c:[].slice.call(arguments,0),function(d){var e=[];return b.each(c,function(c){e=e.concat(a(b.toStr(d[c])))}),e}}}return{nonword:c,whitespace:a,obj:{nonword:d(c),whitespace:d(a)}}}(),e=function(){"use strict";function c(c){this.maxSize=b.isNumber(c)?c:100,this.reset(),this.maxSize<=0&&(this.set=this.get=a.noop)}function d(){this.head=this.tail=null}function e(a,b){this.key=a,this.val=b,this.prev=this.next=null}return b.mixin(c.prototype,{set:function(a,b){var c,d=this.list.tail;this.size>=this.maxSize&&(this.list.remove(d),delete this.hash[d.key],this.size--),(c=this.hash[a])?(c.val=b,this.list.moveToFront(c)):(c=new e(a,b),this.list.add(c),this.hash[a]=c,this.size++)},get:function(a){var b=this.hash[a];return b?(this.list.moveToFront(b),b.val):void 0},reset:function(){this.size=0,this.hash={},this.list=new d}}),b.mixin(d.prototype,{add:function(a){this.head&&(a.next=this.head,this.head.prev=a),this.head=a,this.tail=this.tail||a},remove:function(a){a.prev?a.prev.next=a.next:this.head=a.next,a.next?a.next.prev=a.prev:this.tail=a.prev},moveToFront:function(a){this.remove(a),this.add(a)}}),c}(),f=function(){"use strict";function c(a,c){this.prefix=["__",a,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+b.escapeRegExChars(this.prefix)),this.ls=c||h,!this.ls&&this._noop()}function d(){return(new Date).getTime()}function e(a){return JSON.stringify(b.isUndefined(a)?null:a)}function f(b){return a.parseJSON(b)}function g(a){var b,c,d=[],e=h.length;for(b=0;e>b;b++)(c=h.key(b)).match(a)&&d.push(c.replace(a,""));return d}var h;try{h=window.localStorage,h.setItem("~~~","!"),h.removeItem("~~~")}catch(i){h=null}return b.mixin(c.prototype,{_prefix:function(a){return this.prefix+a},_ttlKey:function(a){return this._prefix(a)+this.ttlKey},_noop:function(){this.get=this.set=this.remove=this.clear=this.isExpired=b.noop},_safeSet:function(a,b){try{this.ls.setItem(a,b)}catch(c){"QuotaExceededError"===c.name&&(this.clear(),this._noop())}},get:function(a){return this.isExpired(a)&&this.remove(a),f(this.ls.getItem(this._prefix(a)))},set:function(a,c,f){return b.isNumber(f)?this._safeSet(this._ttlKey(a),e(d()+f)):this.ls.removeItem(this._ttlKey(a)),this._safeSet(this._prefix(a),e(c))},remove:function(a){return this.ls.removeItem(this._ttlKey(a)),this.ls.removeItem(this._prefix(a)),this},clear:function(){var a,b=g(this.keyMatcher);for(a=b.length;a--;)this.remove(b[a]);return this},isExpired:function(a){var c=f(this.ls.getItem(this._ttlKey(a)));return b.isNumber(c)&&d()>c?!0:!1}}),c}(),g=function(){"use strict";function c(a){a=a||{},this.cancelled=!1,this.lastReq=null,this._send=a.transport,this._get=a.limiter?a.limiter(this._get):this._get,this._cache=a.cache===!1?new e(0):h}var d=0,f={},g=6,h=new e(10);return c.setMaxPendingRequests=function(a){g=a},c.resetCache=function(){h.reset()},b.mixin(c.prototype,{_fingerprint:function(b){return b=b||{},b.url+b.type+a.param(b.data||{})},_get:function(a,b){function c(a){b(null,a),k._cache.set(i,a)}function e(){b(!0)}function h(){d--,delete f[i],k.onDeckRequestArgs&&(k._get.apply(k,k.onDeckRequestArgs),k.onDeckRequestArgs=null)}var i,j,k=this;i=this._fingerprint(a),this.cancelled||i!==this.lastReq||((j=f[i])?j.done(c).fail(e):g>d?(d++,f[i]=this._send(a).done(c).fail(e).always(h)):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(c,d){var e,f;d=d||a.noop,c=b.isString(c)?{url:c}:c||{},f=this._fingerprint(c),this.cancelled=!1,this.lastReq=f,(e=this._cache.get(f))?d(null,e):this._get(c,d)},cancel:function(){this.cancelled=!0}}),c}(),h=window.SearchIndex=function(){"use strict";function c(c){c=c||{},c.datumTokenizer&&c.queryTokenizer||a.error("datumTokenizer and queryTokenizer are both required"),this.identify=c.identify||b.stringify,this.datumTokenizer=c.datumTokenizer,this.queryTokenizer=c.queryTokenizer,this.reset()}function d(a){return a=b.filter(a,function(a){return!!a}),a=b.map(a,function(a){return a.toLowerCase()})}function e(){var a={};return a[i]=[],a[h]={},a}function f(a){for(var b={},c=[],d=0,e=a.length;e>d;d++)b[a[d]]||(b[a[d]]=!0,c.push(a[d]));return c}function g(a,b){var c=0,d=0,e=[];a=a.sort(),b=b.sort();for(var f=a.length,g=b.length;f>c&&g>d;)a[c]<b[d]?c++:a[c]>b[d]?d++:(e.push(a[c]),c++,d++);return e}var h="c",i="i";return b.mixin(c.prototype,{bootstrap:function(a){this.datums=a.datums,this.trie=a.trie},add:function(a){var c=this;a=b.isArray(a)?a:[a],b.each(a,function(a){var f,g;c.datums[f=c.identify(a)]=a,g=d(c.datumTokenizer(a)),b.each(g,function(a){var b,d,g;for(b=c.trie,d=a.split("");g=d.shift();)b=b[h][g]||(b[h][g]=e()),b[i].push(f)})})},get:function(a){var c=this;return b.map(a,function(a){return c.datums[a]})},search:function(a){var c,e,j=this;return c=d(this.queryTokenizer(a)),b.each(c,function(a){var b,c,d,f;if(e&&0===e.length)return!1;for(b=j.trie,c=a.split("");b&&(d=c.shift());)b=b[h][d];return b&&0===c.length?(f=b[i].slice(0),void(e=e?g(e,f):f)):(e=[],!1)}),e?b.map(f(e),function(a){return j.datums[a]}):[]},all:function(){var a=[];for(var b in this.datums)a.push(this.datums[b]);return a},reset:function(){this.datums={},this.trie=e()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),c}(),i=function(){"use strict";function a(a){this.url=a.url,this.ttl=a.ttl,this.cache=a.cache,this.prepare=a.prepare,this.transform=a.transform,this.transport=a.transport,this.thumbprint=a.thumbprint,this.storage=new f(a.cacheKey)}var c;return c={data:"data",protocol:"protocol",thumbprint:"thumbprint"},b.mixin(a.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},store:function(a){this.cache&&(this.storage.set(c.data,a,this.ttl),this.storage.set(c.protocol,location.protocol,this.ttl),this.storage.set(c.thumbprint,this.thumbprint,this.ttl))},fromCache:function(){var a,b={};return this.cache?(b.data=this.storage.get(c.data),b.protocol=this.storage.get(c.protocol),b.thumbprint=this.storage.get(c.thumbprint),a=b.thumbprint!==this.thumbprint||b.protocol!==location.protocol,b.data&&!a?b.data:null):null},fromNetwork:function(a){function b(){a(!0)}function c(b){a(null,e.transform(b))}var d,e=this;a&&(d=this.prepare(this._settings()),this.transport(d).fail(b).done(c))},clear:function(){return this.storage.clear(),this}}),a}(),j=function(){"use strict";function a(a){this.url=a.url,this.prepare=a.prepare,this.transform=a.transform,this.transport=new g({cache:a.cache,limiter:a.limiter,transport:a.transport})}return b.mixin(a.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},get:function(a,b){function c(a,c){b(a?[]:e.transform(c))}var d,e=this;if(b)return a=a||"",d=this.prepare(a,this._settings()),this.transport.get(d,c)},cancelLastRequest:function(){this.transport.cancel()}}),a}(),k=function(){"use strict";function d(d){var e;return d?(e={url:null,ttl:864e5,cache:!0,cacheKey:null,thumbprint:"",prepare:b.identity,transform:b.identity,transport:null},d=b.isString(d)?{url:d}:d,d=b.mixin(e,d),!d.url&&a.error("prefetch requires url to be set"),d.transform=d.filter||d.transform,d.cacheKey=d.cacheKey||d.url,d.thumbprint=c+d.thumbprint,d.transport=d.transport?h(d.transport):a.ajax,d):null}function e(c){var d;if(c)return d={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:b.identity,transport:null},c=b.isString(c)?{url:c}:c,c=b.mixin(d,c),!c.url&&a.error("remote requires url to be set"),c.transform=c.filter||c.transform,c.prepare=f(c),c.limiter=g(c),c.transport=c.transport?h(c.transport):a.ajax,delete c.replace,delete c.wildcard,delete c.rateLimitBy,delete c.rateLimitWait,c}function f(a){function b(a,b){return b.url=f(b.url,a),b}function c(a,b){return b.url=b.url.replace(g,encodeURIComponent(a)),b}function d(a,b){return b}var e,f,g;return e=a.prepare,f=a.replace,g=a.wildcard,e?e:e=f?b:a.wildcard?c:d}function g(a){function c(a){return function(c){return b.debounce(c,a)}}function d(a){return function(c){return b.throttle(c,a)}}var e,f,g;return e=a.limiter,f=a.rateLimitBy,g=a.rateLimitWait,e||(e=/^throttle$/i.test(f)?d(g):c(g)),e}function h(c){return function(d){function e(a){b.defer(function(){g.resolve(a)})}function f(a){b.defer(function(){g.reject(a)})}var g=a.Deferred();return c(d,e,f),g}}return function(c){var f,g;return f={initialize:!0,identify:b.stringify,datumTokenizer:null,queryTokenizer:null,sufficient:5,sorter:null,local:[],prefetch:null,remote:null},c=b.mixin(f,c||{}),!c.datumTokenizer&&a.error("datumTokenizer is required"),!c.queryTokenizer&&a.error("queryTokenizer is required"),g=c.sorter,c.sorter=g?function(a){return a.sort(g)}:b.identity,c.local=b.isFunction(c.local)?c.local():c.local,c.prefetch=d(c.prefetch),c.remote=e(c.remote),c}}(),l=function(){"use strict";function c(a){a=k(a),this.sorter=a.sorter,this.identify=a.identify,this.sufficient=a.sufficient,this.local=a.local,this.remote=a.remote?new j(a.remote):null,this.prefetch=a.prefetch?new i(a.prefetch):null,this.index=new h({identify:this.identify,datumTokenizer:a.datumTokenizer,queryTokenizer:a.queryTokenizer}),a.initialize!==!1&&this.initialize()}var e;return e=window&&window.Bloodhound,c.noConflict=function(){return window&&(window.Bloodhound=e),c},c.tokenizers=d,b.mixin(c.prototype,{__ttAdapter:function(){function a(a,b,d){return c.search(a,b,d)}function b(a,b){return c.search(a,b)}var c=this;return this.remote?a:b},_loadPrefetch:function(){function b(a,b){return a?c.reject():(e.add(b),e.prefetch.store(e.index.serialize()),void c.resolve())}var c,d,e=this;return c=a.Deferred(),this.prefetch?(d=this.prefetch.fromCache())?(this.index.bootstrap(d),c.resolve()):this.prefetch.fromNetwork(b):c.resolve(),c.promise()},_initialize:function(){function a(){b.add(b.local)}var b=this;return this.clear(),(this.initPromise=this._loadPrefetch()).done(a),this.initPromise},initialize:function(a){return!this.initPromise||a?this._initialize():this.initPromise},add:function(a){return this.index.add(a),this},get:function(a){return a=b.isArray(a)?a:[].slice.call(arguments),this.index.get(a)},search:function(a,c,d){function e(a){var c=[];b.each(a,function(a){!b.some(f,function(b){return g.identify(a)===g.identify(b)})&&c.push(a)}),d&&d(c)}var f,g=this;return f=this.sorter(this.index.search(a)),c(this.remote?f.slice():f),this.remote&&f.length<this.sufficient?this.remote.get(a,e):this.remote&&this.remote.cancelLastRequest(),this},all:function(){return this.index.all()},clear:function(){return this.index.reset(),this},clearPrefetchCache:function(){return this.prefetch&&this.prefetch.clear(),this},clearRemoteCache:function(){return g.resetCache(),this},ttAdapter:function(){return this.__ttAdapter()}}),c}();return l}),function(a,b){"function"==typeof define&&define.amd?define("typeahead.js",["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){var b=function(){"use strict";return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(a){return!a||/^\s*$/.test(a)},escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(a){return"string"==typeof a},isNumber:function(a){return"number"==typeof a},isArray:a.isArray,isFunction:a.isFunction,isObject:a.isPlainObject,isUndefined:function(a){return"undefined"==typeof a},isElement:function(a){return!(!a||1!==a.nodeType)},isJQuery:function(b){return b instanceof a},toStr:function(a){return b.isUndefined(a)||null===a?"":a+""},bind:a.proxy,each:function(b,c){function d(a,b){return c(b,a)}a.each(b,d)},map:a.map,filter:a.grep,every:function(b,c){var d=!0;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?void 0:!1}),!!d):d},some:function(b,c){var d=!1;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?!1:void 0}),!!d):d},mixin:a.extend,identity:function(a){return a},clone:function(b){return a.extend(!0,{},b)},getIdGenerator:function(){var a=0;return function(){return a++}},templatify:function(b){function c(){return String(b)}return a.isFunction(b)?b:c},defer:function(a){setTimeout(a,0)},debounce:function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return f=function(){d=null,c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},throttle:function(a,b){var c,d,e,f,g,h;return g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)},function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},stringify:function(a){return b.isString(a)?a:JSON.stringify(a)},noop:function(){}}}(),c=function(){"use strict";function a(a){var g,h;return h=b.mixin({},f,a),g={css:e(),classes:h,html:c(h),selectors:d(h)},{css:g.css,html:g.html,classes:g.classes,selectors:g.selectors,mixin:function(a){b.mixin(a,g)}}}function c(a){return{wrapper:'<span class="'+a.wrapper+'"></span>',menu:'<div class="'+a.menu+'"></div>'}}function d(a){var c={};return b.each(a,function(a,b){c[b]="."+a}),c}function e(){var a={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return b.isMsie()&&b.mixin(a.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),a}var f={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-open",cursor:"tt-cursor",highlight:"tt-highlight"};return a}(),d=function(){"use strict";function c(b){b&&b.el||a.error("EventBus initialized without el"),this.$el=a(b.el)}var d,e;return d="typeahead:",e={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},b.mixin(c.prototype,{_trigger:function(b,c){var e;return e=a.Event(d+b),(c=c||[]).unshift(e),this.$el.trigger.apply(this.$el,c),e},before:function(a){var b,c;return b=[].slice.call(arguments,1),c=this._trigger("before"+a,b),c.isDefaultPrevented()},trigger:function(a){var b;this._trigger(a,[].slice.call(arguments,1)),(b=e[a])&&this._trigger(b,[].slice.call(arguments,1))}}),c}(),e=function(){"use strict";function a(a,b,c,d){var e;if(!c)return this;for(b=b.split(i),c=d?h(c,d):c,this._callbacks=this._callbacks||{};e=b.shift();)this._callbacks[e]=this._callbacks[e]||{sync:[],async:[]},this._callbacks[e][a].push(c);return this}function b(b,c,d){return a.call(this,"async",b,c,d)}function c(b,c,d){return a.call(this,"sync",b,c,d)}function d(a){var b;if(!this._callbacks)return this;for(a=a.split(i);b=a.shift();)delete this._callbacks[b];return this}function e(a){var b,c,d,e,g;if(!this._callbacks)return this;for(a=a.split(i),d=[].slice.call(arguments,1);(b=a.shift())&&(c=this._callbacks[b]);)e=f(c.sync,this,[b].concat(d)),g=f(c.async,this,[b].concat(d)),e()&&j(g);return this}function f(a,b,c){function d(){for(var d,e=0,f=a.length;!d&&f>e;e+=1)d=a[e].apply(b,c)===!1;return!d}return d}function g(){var a;return a=window.setImmediate?function(a){setImmediate(function(){a()})}:function(a){setTimeout(function(){a()},0)}}function h(a,b){return a.bind?a.bind(b):function(){a.apply(b,[].slice.call(arguments,0))}}var i=/\s+/,j=g();return{onSync:c,onAsync:b,off:d,trigger:e}}(),f=function(a){"use strict";function c(a,c,d){for(var e,f=[],g=0,h=a.length;h>g;g++)f.push(b.escapeRegExChars(a[g]));return e=d?"\\b("+f.join("|")+")\\b":"("+f.join("|")+")",c?new RegExp(e):new RegExp(e,"i")}var d={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(e){function f(b){var c,d,f;return(c=h.exec(b.data))&&(f=a.createElement(e.tagName),e.className&&(f.className=e.className),d=b.splitText(c.index),d.splitText(c[0].length),f.appendChild(d.cloneNode(!0)),b.parentNode.replaceChild(f,d)),!!c}function g(a,b){for(var c,d=3,e=0;e<a.childNodes.length;e++)c=a.childNodes[e],c.nodeType===d?e+=b(c)?1:0:g(c,b)}var h;e=b.mixin({},d,e),e.node&&e.pattern&&(e.pattern=b.isArray(e.pattern)?e.pattern:[e.pattern],h=c(e.pattern,e.caseSensitive,e.wordsOnly),g(e.node,f))}}(window.document),g=function(){"use strict";function c(c,e){c=c||{},c.input||a.error("input is missing"),e.mixin(this),this.$hint=a(c.hint),this.$input=a(c.input),this.query=this.$input.val(),this.queryWhenFocused=this.hasFocus()?this.query:null,this.$overflowHelper=d(this.$input),this._checkLanguageDirection(),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=b.noop)}function d(b){return a('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:b.css("font-family"),fontSize:b.css("font-size"),fontStyle:b.css("font-style"),fontVariant:b.css("font-variant"),fontWeight:b.css("font-weight"),wordSpacing:b.css("word-spacing"),letterSpacing:b.css("letter-spacing"),textIndent:b.css("text-indent"),textRendering:b.css("text-rendering"),textTransform:b.css("text-transform")}).insertAfter(b)}function f(a,b){return c.normalizeQuery(a)===c.normalizeQuery(b)}function g(a){return a.altKey||a.ctrlKey||a.metaKey||a.shiftKey}var h;return h={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},c.normalizeQuery=function(a){return b.toStr(a).replace(/^\s*/g,"").replace(/\s{2,}/g," ")},b.mixin(c.prototype,e,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.queryWhenFocused=this.query,this.trigger("focused")},_onKeydown:function(a){var b=h[a.which||a.keyCode];this._managePreventDefault(b,a),b&&this._shouldTrigger(b,a)&&this.trigger(b+"Keyed",a)},_onInput:function(){this._setQuery(this.getInputValue()),this.clearHintIfInvalid(),this._checkLanguageDirection()},_managePreventDefault:function(a,b){var c;switch(a){case"up":case"down":c=!g(b);break;default:c=!1}c&&b.preventDefault()},_shouldTrigger:function(a,b){var c;switch(a){case"tab":c=!g(b);break;default:c=!0}return c},_checkLanguageDirection:function(){var a=(this.$input.css("direction")||"ltr").toLowerCase();this.dir!==a&&(this.dir=a,this.$hint.attr("dir",a),this.trigger("langDirChanged",a))},_setQuery:function(a,b){var c,d;c=f(a,this.query),d=c?this.query.length!==a.length:!1,this.query=a,b||c?!b&&d&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},bind:function(){var a,c,d,e,f=this;return a=b.bind(this._onBlur,this),c=b.bind(this._onFocus,this),d=b.bind(this._onKeydown,this),e=b.bind(this._onInput,this),this.$input.on("blur.tt",a).on("focus.tt",c).on("keydown.tt",d),!b.isMsie()||b.isMsie()>9?this.$input.on("input.tt",e):this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(a){h[a.which||a.keyCode]||b.defer(b.bind(f._onInput,f,a))}),this},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getLangDir:function(){return this.dir},getQuery:function(){return this.query||""},setQuery:function(a,b){this.setInputValue(a),this._setQuery(a,b)},hasQueryChangedSinceLastFocus:function(){return this.query!==this.queryWhenFocused},getInputValue:function(){return this.$input.val()},setInputValue:function(a){this.$input.val(a),this.clearHintIfInvalid(),this._checkLanguageDirection()},resetInputValue:function(){this.setInputValue(this.query)},getHint:function(){return this.$hint.val()},setHint:function(a){this.$hint.val(a)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var a,b,c,d;a=this.getInputValue(),b=this.getHint(),c=a!==b&&0===b.indexOf(a),d=""!==a&&c&&!this.hasOverflow(),!d&&this.clearHint()},hasFocus:function(){return this.$input.is(":focus")},hasOverflow:function(){var a=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=a},isCursorAtEnd:function(){var a,c,d;return a=this.$input.val().length,c=this.$input[0].selectionStart,b.isNumber(c)?c===a:document.selection?(d=document.selection.createRange(),d.moveStart("character",-a),a===d.text.length):!0},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$overflowHelper.remove(),this.$hint=this.$input=this.$overflowHelper=a("<div>")}}),c}(),h=function(){"use strict";function c(c,e){c=c||{},c.templates=c.templates||{},c.templates.notFound=c.templates.notFound||c.templates.empty,c.source||a.error("missing source"),c.node||a.error("missing node"),c.name&&!h(c.name)&&a.error("invalid dataset name: "+c.name),e.mixin(this),this.highlight=!!c.highlight,this.name=c.name||j(),this.limit=c.limit||5,this.displayFn=d(c.display||c.displayKey),this.templates=g(c.templates,this.displayFn),this.source=c.source.__ttAdapter?c.source.__ttAdapter():c.source,this.async=b.isUndefined(c.async)?this.source.length>2:!!c.async,this._resetLastSuggestion(),this.$el=a(c.node).addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}function d(a){function c(b){return b[a]}return a=a||b.stringify,b.isFunction(a)?a:c}function g(c,d){function e(b){return a("<div>").text(d(b))}return{notFound:c.notFound&&b.templatify(c.notFound),pending:c.pending&&b.templatify(c.pending),header:c.header&&b.templatify(c.header),footer:c.footer&&b.templatify(c.footer),suggestion:c.suggestion||e}}function h(a){return/^[_a-zA-Z0-9-]+$/.test(a)}var i,j;return i={val:"tt-selectable-display",obj:"tt-selectable-object"},j=b.getIdGenerator(),c.extractData=function(b){var c=a(b);return c.data(i.obj)?{val:c.data(i.val)||"",obj:c.data(i.obj)||null}:null},b.mixin(c.prototype,e,{_overwrite:function(a,b){b=b||[],b.length?this._renderSuggestions(a,b):this.async&&this.templates.pending?this._renderPending(a):!this.async&&this.templates.notFound?this._renderNotFound(a):this._empty(),this.trigger("rendered",this.name,b,!1)},_append:function(a,b){b=b||[],b.length&&this.$lastSuggestion.length?this._appendSuggestions(a,b):b.length?this._renderSuggestions(a,b):!this.$lastSuggestion.length&&this.templates.notFound&&this._renderNotFound(a),this.trigger("rendered",this.name,b,!0)},_renderSuggestions:function(a,b){var c;c=this._getSuggestionsFragment(a,b),this.$lastSuggestion=c.children().last(),this.$el.html(c).prepend(this._getHeader(a,b)).append(this._getFooter(a,b))},_appendSuggestions:function(a,b){var c,d;c=this._getSuggestionsFragment(a,b),d=c.children().last(),this.$lastSuggestion.after(c),this.$lastSuggestion=d},_renderPending:function(a){var b=this.templates.pending;this._resetLastSuggestion(),b&&this.$el.html(b({query:a,dataset:this.name}))},_renderNotFound:function(a){var b=this.templates.notFound;this._resetLastSuggestion(),b&&this.$el.html(b({query:a,dataset:this.name}))},_empty:function(){this.$el.empty(),this._resetLastSuggestion()},_getSuggestionsFragment:function(c,d){var e,g=this;return e=document.createDocumentFragment(),b.each(d,function(b){var d,f;f=g._injectQuery(c,b),d=a(g.templates.suggestion(f)).data(i.obj,b).data(i.val,g.displayFn(b)).addClass(g.classes.suggestion+" "+g.classes.selectable),e.appendChild(d[0])}),this.highlight&&f({className:this.classes.highlight,node:e,pattern:c}),a(e)},_getFooter:function(a,b){return this.templates.footer?this.templates.footer({query:a,suggestions:b,dataset:this.name}):null},_getHeader:function(a,b){return this.templates.header?this.templates.header({query:a,suggestions:b,dataset:this.name}):null},_resetLastSuggestion:function(){this.$lastSuggestion=a()},_injectQuery:function(a,c){return b.isObject(c)?b.mixin({_query:a},c):c},update:function(b){function c(a){g||(g=!0,a=(a||[]).slice(0,e.limit),h=a.length,e._overwrite(b,a),h<e.limit&&e.async&&e.trigger("asyncRequested",b))}function d(c){c=c||[],!f&&h<e.limit&&(e.cancel=a.noop,h+=c.length,e._append(b,c.slice(0,e.limit-h)),e.async&&e.trigger("asyncReceived",b))}var e=this,f=!1,g=!1,h=0;this.cancel(),this.cancel=function(){f=!0,e.cancel=a.noop,e.async&&e.trigger("asyncCanceled",b)},this.source(b,c,d),!g&&c([])},cancel:a.noop,clear:function(){this._empty(),this.cancel(),this.trigger("cleared")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=a("<div>")}}),c}(),i=function(){"use strict";function c(c,d){function e(b){var c=f.$node.find(b.node).first();return b.node=c.length?c:a("<div>").appendTo(f.$node),new h(b,d)}var f=this;c=c||{},c.node||a.error("node is required"),d.mixin(this),this.$node=a(c.node),this.query=null,this.datasets=b.map(c.datasets,e)}return b.mixin(c.prototype,e,{_onSelectableClick:function(b){this.trigger("selectableClicked",a(b.currentTarget))},_onRendered:function(a,b,c,d){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetRendered",b,c,d)},_onCleared:function(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetCleared")},_propagate:function(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function(){function a(a){return a.isEmpty()}return b.every(this.datasets,a)},_getSelectables:function(){return this.$node.find(this.selectors.selectable)},_removeCursor:function(){var a=this.getActiveSelectable();a&&a.removeClass(this.classes.cursor)},_ensureVisible:function(a){var b,c,d,e;b=a.position().top,c=b+a.outerHeight(!0),d=this.$node.scrollTop(),e=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10),0>b?this.$node.scrollTop(d+b):c>e&&this.$node.scrollTop(d+(c-e))},bind:function(){var a,c=this;return a=b.bind(this._onSelectableClick,this),this.$node.on("click.tt",this.selectors.selectable,a),b.each(this.datasets,function(a){a.onSync("asyncRequested",c._propagate,c).onSync("asyncCanceled",c._propagate,c).onSync("asyncReceived",c._propagate,c).onSync("rendered",c._onRendered,c).onSync("cleared",c._onCleared,c)}),this},isOpen:function(){return this.$node.hasClass(this.classes.open)},open:function(){this.$node.addClass(this.classes.open)},close:function(){this.$node.removeClass(this.classes.open),this._removeCursor()},setLanguageDirection:function(a){this.$node.attr("dir",a)},selectableRelativeToCursor:function(a){var b,c,d,e;return c=this.getActiveSelectable(),b=this._getSelectables(),d=c?b.index(c):-1,e=d+a,e=(e+1)%(b.length+1)-1,e=-1>e?b.length-1:e,-1===e?null:b.eq(e)},setCursor:function(a){this._removeCursor(),(a=a&&a.first())&&(a.addClass(this.classes.cursor),this._ensureVisible(a))},getSelectableData:function(a){return a&&a.length?h.extractData(a):null},getActiveSelectable:function(){var a=this._getSelectables().filter(this.selectors.cursor).first();return a.length?a:null},getTopSelectable:function(){var a=this._getSelectables().first();return a.length?a:null},update:function(a){function c(b){b.update(a)}var d=a!==this.query;return d&&(this.query=a,b.each(this.datasets,c)),d},empty:function(){function a(a){a.clear()}b.each(this.datasets,a),this.query=null,this.$node.addClass(this.classes.empty)},destroy:function(){function c(a){a.destroy()}this.$node.off(".tt"),this.$node=a("<div>"),b.each(this.datasets,c)}}),c}(),j=function(){"use strict";function a(){i.apply(this,[].slice.call(arguments,0))}var c=i.prototype;return b.mixin(a.prototype,i.prototype,{open:function(){return!this._allDatasetsEmpty()&&this._show(),c.open.apply(this,[].slice.call(arguments,0))},close:function(){return this._hide(),c.close.apply(this,[].slice.call(arguments,0))},_onRendered:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),c._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),c._onCleared.apply(this,[].slice.call(arguments,0))},setLanguageDirection:function(a){return this.$node.css("ltr"===a?this.css.ltr:this.css.rtl),c.setLanguageDirection.apply(this,[].slice.call(arguments,0))},_hide:function(){this.$node.hide()},_show:function(){this.$node.css("display","block")}}),a}(),k=function(){"use strict";function c(c,e){var f,g,h,i,j,k,l,m,n,o,p;c=c||{},c.input||a.error("missing input"),c.menu||a.error("missing menu"),c.eventBus||a.error("missing event bus"),e.mixin(this),this.eventBus=c.eventBus,this.minLength=b.isNumber(c.minLength)?c.minLength:1,this.input=c.input,this.menu=c.menu,this.enabled=!0,this.active=!1,this.input.hasFocus()&&this.activate(),this.dir=this.input.getLangDir(),this._hacks(),this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this),f=d(this,"activate","open","_onFocused"),g=d(this,"deactivate","_onBlurred"),h=d(this,"isActive","isOpen","_onEnterKeyed"),i=d(this,"isActive","isOpen","_onTabKeyed"),j=d(this,"isActive","_onEscKeyed"),k=d(this,"isActive","open","_onUpKeyed"),l=d(this,"isActive","open","_onDownKeyed"),m=d(this,"isActive","isOpen","_onLeftKeyed"),n=d(this,"isActive","isOpen","_onRightKeyed"),o=d(this,"_openIfActive","_onQueryChanged"),p=d(this,"_openIfActive","_onWhitespaceChanged"),this.input.bind().onSync("focused",f,this).onSync("blurred",g,this).onSync("enterKeyed",h,this).onSync("tabKeyed",i,this).onSync("escKeyed",j,this).onSync("upKeyed",k,this).onSync("downKeyed",l,this).onSync("leftKeyed",m,this).onSync("rightKeyed",n,this).onSync("queryChanged",o,this).onSync("whitespaceChanged",p,this).onSync("langDirChanged",this._onLangDirChanged,this)}function d(a){var c=[].slice.call(arguments,1);return function(){var d=[].slice.call(arguments);b.each(c,function(b){return a[b].apply(a,d)})}}return b.mixin(c.prototype,{_hacks:function(){var c,d;c=this.input.$input||a("<div>"),d=this.menu.$node||a("<div>"),c.on("blur.tt",function(a){var e,f,g;
e=document.activeElement,f=d.is(e),g=d.has(e).length>0,b.isMsie()&&(f||g)&&(a.preventDefault(),a.stopImmediatePropagation(),b.defer(function(){c.focus()}))}),d.on("mousedown.tt",function(a){a.preventDefault()})},_onSelectableClicked:function(a,b){this.select(b)},_onDatasetCleared:function(){this._updateHint()},_onDatasetRendered:function(a,b,c,d){this._updateHint(),this.eventBus.trigger("render",c,d,b)},_onAsyncRequested:function(a,b,c){this.eventBus.trigger("asyncrequest",c,b)},_onAsyncCanceled:function(a,b,c){this.eventBus.trigger("asynccancel",c,b)},_onAsyncReceived:function(a,b,c){this.eventBus.trigger("asyncreceive",c,b)},_onFocused:function(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function(a,b){var c;(c=this.menu.getActiveSelectable())&&this.select(c)&&b.preventDefault()},_onTabKeyed:function(a,b){var c;(c=this.menu.getActiveSelectable())?this.select(c)&&b.preventDefault():(c=this.menu.getTopSelectable())&&this.autocomplete(c)&&b.preventDefault()},_onEscKeyed:function(){this.close()},_onUpKeyed:function(){this.moveCursor(-1)},_onDownKeyed:function(){this.moveCursor(1)},_onLeftKeyed:function(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onRightKeyed:function(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onQueryChanged:function(a,b){this._minLengthMet(b)?this.menu.update(b):this.menu.empty()},_onWhitespaceChanged:function(){this._updateHint()},_onLangDirChanged:function(a,b){this.dir!==b&&(this.dir=b,this.menu.setLanguageDirection(b))},_openIfActive:function(){this.isActive()&&this.open()},_minLengthMet:function(a){return a=b.isString(a)?a:this.input.getQuery()||"",a.length>=this.minLength},_updateHint:function(){var a,c,d,e,f,h,i;a=this.menu.getTopSelectable(),c=this.menu.getSelectableData(a),d=this.input.getInputValue(),!c||b.isBlankString(d)||this.input.hasOverflow()?this.input.clearHint():(e=g.normalizeQuery(d),f=b.escapeRegExChars(e),h=new RegExp("^(?:"+f+")(.+$)","i"),i=h.exec(c.val),i&&this.input.setHint(d+i[1]))},isEnabled:function(){return this.enabled},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},isActive:function(){return this.active},activate:function(){return this.isActive()?!0:!this.isEnabled()||this.eventBus.before("active")?!1:(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function(){return this.isActive()?this.eventBus.before("idle")?!1:(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0):!0},isOpen:function(){return this.menu.isOpen()},open:function(){return this.isOpen()||this.eventBus.before("open")||(this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function(){return this.isOpen()&&!this.eventBus.before("close")&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function(a){this.input.setQuery(b.toStr(a))},getVal:function(){return this.input.getQuery()},select:function(a){var b=this.menu.getSelectableData(a);return b&&!this.eventBus.before("select",b.obj)?(this.input.setQuery(b.val,!0),this.eventBus.trigger("select",b.obj),this.close(),!0):!1},autocomplete:function(a){var b,c,d;return b=this.input.getQuery(),c=this.menu.getSelectableData(a),d=c&&b!==c.val,d&&!this.eventBus.before("autocomplete",c.obj)?(this.input.setQuery(c.val),this.eventBus.trigger("autocomplete",c.obj),!0):!1},moveCursor:function(a){var b,c,d,e,f;return b=this.input.getQuery(),c=this.menu.selectableRelativeToCursor(a),d=this.menu.getSelectableData(c),e=d?d.obj:null,f=this._minLengthMet()&&this.menu.update(b),f||this.eventBus.before("cursorchange",e)?!1:(this.menu.setCursor(c),d?this.input.setInputValue(d.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",e),!0)},destroy:function(){this.input.destroy(),this.menu.destroy()}}),c}();!function(){"use strict";function e(b,c){b.each(function(){var b,d=a(this);(b=d.data(p.typeahead))&&c(b,d)})}function f(a,b){return a.clone().addClass(b.classes.hint).removeData().css(b.css.hint).css(l(a)).prop("readonly",!0).removeAttr("id name placeholder required").attr({autocomplete:"off",spellcheck:"false",tabindex:-1})}function h(a,b){a.data(p.attrs,{dir:a.attr("dir"),autocomplete:a.attr("autocomplete"),spellcheck:a.attr("spellcheck"),style:a.attr("style")}),a.addClass(b.classes.input).attr({autocomplete:"off",spellcheck:!1});try{!a.attr("dir")&&a.attr("dir","auto")}catch(c){}return a}function l(a){return{backgroundAttachment:a.css("background-attachment"),backgroundClip:a.css("background-clip"),backgroundColor:a.css("background-color"),backgroundImage:a.css("background-image"),backgroundOrigin:a.css("background-origin"),backgroundPosition:a.css("background-position"),backgroundRepeat:a.css("background-repeat"),backgroundSize:a.css("background-size")}}function m(a){var c,d;c=a.data(p.www),d=a.parent().filter(c.selectors.wrapper),b.each(a.data(p.attrs),function(c,d){b.isUndefined(c)?a.removeAttr(d):a.attr(d,c)}),a.removeData(p.typeahead).removeData(p.www).removeData(p.attr).removeClass(c.classes.input),d.length&&(a.detach().insertAfter(d),d.remove())}function n(c){var d,e;return d=b.isJQuery(c)||b.isElement(c),e=d?a(c).first():[],e.length?e:null}var o,p,q;o=a.fn.typeahead,p={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"},q={initialize:function(e,l){function m(){var c,m,q,r,s,t,u,v,w,x,y;b.each(l,function(a){a.highlight=!!e.highlight}),c=a(this),m=a(o.html.wrapper),q=n(e.hint),r=n(e.menu),s=e.hint!==!1&&!q,t=e.menu!==!1&&!r,s&&(q=f(c,o)),t&&(r=a(o.html.menu).css(o.css.menu)),q&&q.val(""),c=h(c,o),(s||t)&&(m.css(o.css.wrapper),c.css(s?o.css.input:o.css.inputWithNoHint),c.wrap(m).parent().prepend(s?q:null).append(t?r:null)),y=t?j:i,u=new d({el:c}),v=new g({hint:q,input:c},o),w=new y({node:r,datasets:l},o),x=new k({input:v,menu:w,eventBus:u,minLength:e.minLength},o),c.data(p.www,o),c.data(p.typeahead,x)}var o;return l=b.isArray(l)?l:[].slice.call(arguments,1),e=e||{},o=c(e.classNames),this.each(m)},isEnabled:function(){var a;return e(this.first(),function(b){a=b.isEnabled()}),a},enable:function(){return e(this,function(a){a.enable()}),this},disable:function(){return e(this,function(a){a.disable()}),this},isActive:function(){var a;return e(this.first(),function(b){a=b.isActive()}),a},activate:function(){return e(this,function(a){a.activate()}),this},deactivate:function(){return e(this,function(a){a.deactivate()}),this},isOpen:function(){var a;return e(this.first(),function(b){a=b.isOpen()}),a},open:function(){return e(this,function(a){a.open()}),this},close:function(){return e(this,function(a){a.close()}),this},select:function(b){var c=!1,d=a(b);return e(this.first(),function(a){c=a.select(d)}),c},autocomplete:function(b){var c=!1,d=a(b);return e(this.first(),function(a){c=a.autocomplete(d)}),c},moveCursor:function(a){var b=!1;return e(this.first(),function(c){b=c.moveCursor(a)}),b},val:function(a){var b;return arguments.length?(e(this,function(b){b.setVal(a)}),this):(e(this.first(),function(a){b=a.getVal()}),b)},destroy:function(){return e(this,function(a,b){m(b),a.destroy()}),this}},a.fn.typeahead=function(a){return q[a]?q[a].apply(this,[].slice.call(arguments,1)):q.initialize.apply(this,arguments)},a.fn.typeahead.noConflict=function(){return a.fn.typeahead=o,this}}()});

/* end /scripts/libs/jquery/plugins/typeahead-bloodhound.min.js*/

/* start /scripts/_pages/careers.js*/
var DGC=DGC||{};$(document).ready(function(){'use strict';DGC.careers.init();});DGC.careers=(function($,_){'use strict';var _jobs,_mode$,_jobIds,_reSet$,_attempt,_boxWrap$,_jobList$,_jobCount$,_jobTitles,_jobsDisplayed,_carouselIndex,_listContainer$,_blockHeadline$,_jobBoxTemplate,_jobViewPosition,_uniqueLocations,_detailContainer$,_jobLocationList$,_uniqueDepartments,_jobDetailTemplate,_jobDepartmentList,_jobDepartmentList$,_uniqueLocationFilters,_listDepartmentTemplate,_uniqueDepartmentFilters,_jobListOrDetailContainer,_queryKeys=['department','location','job','gh_jid','gh_src'],_filterFns={location:undefined,department:undefined,gh_jid:undefined,job:undefined},_tagLines=['ARE YOU CREATIVE?','ARE YOU AMBITIOUS?','ARE YOU PASSIONATE?'];var _sortJobsDeptByNameAsc=R.ascend(R.prop('department'));var _locationName=R.pipe(R.prop('location'),R.prop('name'));var _locationClass=R.pipe(R.prop('location'),R.prop('name'),R.toLower,R.replace(/[^\w]+/g,'-'));var _normalizeStringForReference=R.pipe(R.toLower,R.replace(/[^\w]+/g,'_'));var _normalizeStringForClassName=R.pipe(R.toLower,R.replace(/[^\w]+/g,'-'));var _pairValueNotNil=R.pipe(R.nth(1),R.isNil,R.not);var _objToParams=R.pipe(R.toPairs,R.filter(_pairValueNotNil),R.map(R.map(encodeURIComponent)),R.map(R.join('=')),R.join('&'));var _updateQueryString=R.pipe(_objToParams,_updateUrlParams);function _groupJobsByDepartment(jobs,uniqueDepartments){return uniqueDepartments.map(function(departmentFilter,index){var jobsByDept=jobs.filter(function(job){return uniqueDepartments[index]==job.departmentFilter;});var locationsWithin=R.uniq(R.map(R.prop('locationFilter'),jobsByDept));return{className:jobsByDept[0].className,count:jobsByDept.length,departmentFilter:departmentFilter,locations:locationsWithin,toggle:"&#150;",list:jobsByDept,name:jobsByDept[0].department}});}
function _buildFilterListMarkup(property,filterIds,stringNames){var listItems='';filterIds.map(function(filter,i){listItems+='<li><a href="'+filter+'" class="job-filter" data-filter-value="'+filter+'" rel="'+property+'">'+stringNames[i]+'</a></li>';})
return listItems;}
function _flattenNestedJobData(jobs){return jobs.map(function(job){if(typeof job.offices[0].name==="undefined"||typeof job.offices[0].name==null){console.log("%cERROR: The "+job.title+" location name is not defined under offices",'background: #222; color: #bada55')}
if(typeof job.departments[0].name==="undefined"||typeof job.departments[0].name==null){console.log("%cERROR: The "+job.title+" department name is not defined under departments",'background: #222; color: #bada55')}
if(typeof job.offices[0].location==="undefined"||typeof job.offices[0].location==null){console.log("%cERROR: The "+job.title+" location is not defined under offices",'background: #222; color: #bada55')}
if(job.offices[0].location.split(',').length<2){console.log("%cERROR: The "+job.title+" location is missing information",'background: #222; color: #bada55')}
return{id:job.id,display:"list-item",title:job.title,jobFilter:job.id,content:job.content,city:job.offices[0].name,updated_at:job.updated_at,location:job.offices[0].name,department:job.departments[0].name,className:_normalizeStringForClassName(job.departments[0].name),locationFilter:_normalizeStringForReference(job.offices[0].name),fullLocation:job.offices[0].location.split(',').slice(0,2).join(','),departmentFilter:_normalizeStringForReference(job.departments[0].name)}})}
function _formatAndRenderData(data){var randomDept=[];var jobMap={};var randomNumber;var flattend=_flattenNestedJobData(data.jobs);var sortedJobs=flattend.sort(_sortJobsDeptByNameAsc)
_jobsDisplayed=sortedJobs.length;_jobCount$.text(_jobsDisplayed);_uniqueDepartments=R.uniq(R.chain(R.prop('department'))(sortedJobs));_uniqueDepartmentFilters=R.uniq(R.chain(R.prop('departmentFilter'))(sortedJobs));_jobIds=R.chain(R.prop('id'))(sortedJobs);_jobTitles=R.chain(R.prop('title'))(sortedJobs);_uniqueLocations=R.uniq(R.chain(R.prop('location'))(sortedJobs));_uniqueLocationFilters=R.uniq(R.chain(R.pipe(R.prop('location'),_normalizeStringForReference))(sortedJobs));_jobs={cache:sortedJobs,typeaheadTitles:_jobTitles,typeaheadDepts:_uniqueDepartments,departments:_groupJobsByDepartment(sortedJobs,_uniqueDepartmentFilters)};if(_jobs.departments.length>8){for(var i=0;i<8;){randomNumber=Math.floor(Math.random()*_jobs.departments.length);if(!(randomNumber in jobMap)){jobMap[randomNumber]='unique';var stats={title:_jobs.departments[randomNumber].name,count:_jobs.departments[randomNumber].count,href:_jobs.departments[randomNumber].departmentFilter,city:_jobs.departments[randomNumber].list[0].fullLocation}
randomDept.push({department:stats});i++;}
if(Object.keys(jobMap).length>100){i=8;console.log('[JOBS] Error in random generator')}}
if(randomDept.length==8){_boxWrap$.html(_jobBoxTemplate({boxes:randomDept}));}}else{for(var i=0;i<8;i++){var stats={};if(i>_jobs.departments.length-1){}else{stats={title:_jobs.departments[i].name,count:_jobs.departments[i].count,href:_jobs.departments[i].departmentFilter,city:_jobs.departments[i].list[0].fullLocation}}
randomDept.push({department:stats});}
_boxWrap$.html(_jobBoxTemplate({boxes:randomDept}));}
_jobDepartmentList$.html(_buildFilterListMarkup('department',_uniqueDepartmentFilters,_uniqueDepartments));_jobLocationList$.html(_buildFilterListMarkup('location',_uniqueLocationFilters,_uniqueLocations));_searchInit();_renderIntent();}
function _searchInit(){var departments=new Bloodhound({datumTokenizer:Bloodhound.tokenizers.whitespace,queryTokenizer:Bloodhound.tokenizers.whitespace,local:_jobs.typeaheadDepts});var titles=new Bloodhound({datumTokenizer:Bloodhound.tokenizers.whitespace,queryTokenizer:Bloodhound.tokenizers.whitespace,local:_jobs.typeaheadTitles});$('.typeahead').typeahead({highlight:true},{name:'department',source:departments,templates:{header:'<h3 class="department-name">Teams</h3>'}},{name:'title',source:titles,templates:{header:'<h3 class="job-title">Positions</h3>'}});$('.typeahead').bind('typeahead:select',function(event,suggestion){var index,id,deptFilter;if(_jobTitles.indexOf(suggestion)>=0){index=_jobTitles.indexOf(suggestion);id=_jobIds[index];deptFilter=R.prop('departmentFilter',R.find(R.propEq('id',id),_jobs.cache));_renderJobDetail(id,deptFilter);_filterFns['department']=undefined;_filterFns['location']=undefined;_filterFns['job']=id;_updateQueryString(_filterFns);}
if(_uniqueDepartments.indexOf(suggestion)>=0){deptFilter=_normalizeStringForReference(suggestion);_reSet$.addClass('active');$(".job-filter[data-filter-value='"+deptFilter+"']").trigger("click");}});}
function _exclusiveFilter(filterKeyValuePairs,listOfLists){_jobsDisplayed=_jobs.cache.length;var filterFunctions=R.toPairs(filterKeyValuePairs).filter(_pairValueNotNil).map(function(pair){return R.propEq(pair[0]+'Filter',pair[1]);});return listOfLists.map(function(dept){var childList=dept.list.map(function(job){var allFiltersPass=R.allPass(filterFunctions);_jobsDisplayed=(allFiltersPass(job)?_jobsDisplayed:_jobsDisplayed-1);return JSON.parse(JSON.stringify({id:job.id,display:(allFiltersPass(job)?"list-item":"none"),title:job.title,jobFilter:job.jobFilter,content:job.content,city:job.city,updated_at:job.updated_at,location:job.location,department:job.department,className:job.className,locationFilter:job.locationFilter,fullLocation:job.fullLocation,departmentFilter:job.departmentFilter}));})
var hidden=R.propEq('display','none');var allHidden=R.all(hidden,childList);return{className:dept.className,count:dept.count,locations:dept.locations,departmentFilter:dept.departmentFilter,toggle:(allHidden?"&#43;":"&#150;"),list:childList,name:dept.name}});}
function _inclusiveFilter(show,department){_jobsDisplayed=_jobs.cache.length;_jobs.departments=_jobs.departments.map(function(dept){var value=dept.toggle;if(dept.departmentFilter==department&&show){value="&#150;";}
if(dept.departmentFilter==department&&!show){value="&#43;";}
return{className:dept.className,count:dept.count,locations:dept.locations,departmentFilter:dept.departmentFilter,toggle:value,list:dept.list.map(function(job){var value=job.display;if(job.departmentFilter==department&&show){value="list-item";}
if(job.departmentFilter==department&&!show){value="none";_jobsDisplayed=_jobsDisplayed-1;}
return JSON.parse(JSON.stringify({id:job.id,display:value,title:job.title,jobFilter:job.jobFilter,content:job.content,city:job.city,updated_at:job.updated_at,location:job.location,department:job.department,className:job.className,locationFilter:job.locationFilter,fullLocation:job.fullLocation,departmentFilter:job.departmentFilter}));}),name:dept.name}});_listContainer$.html(_listDepartmentTemplate({departments:_jobs.departments}));}
function _renderJobsByDepartment(){_jobs.departments=_exclusiveFilter(_filterFns,_jobs.departments);if(_jobsDisplayed==_jobs.cache.length){$('.filter-count').text('Showing all Jobs');}else{$('.filter-count').text('Showing '+_jobsDisplayed+' of '+_jobs.cache.length+' Jobs');}
_listContainer$.html(_listDepartmentTemplate({departments:_jobs.departments}));}
function _renderJobDetail(jobId,dept){var job=R.find(R.propEq('id',Number(jobId)),R.prop('list',R.find(R.propEq('departmentFilter',dept),_jobs.departments)));if(job){_detailContainer$.html(_jobDetailTemplate({job:job}));var node$=$('.job-detail-description');node$.html(job.content);node$.html(node$.text());_mode$.removeClass('active');$('#detail').addClass('active');var pos=window.pageYOffset||document.documentElement.scrollTop;_scrollToJobView();}}
function _sortListElement(list,listItems){listItems.sort(function(a,b){var keyA=$(a).text();var keyB=$(b).text();if(keyA<keyB){return-1;}
if(keyA>keyB){return 1;}
return 0;});$.each(listItems,function(i,li){list.append(li);});}
function _requestJobs(){var greenhouse='/rest/careers_feed';_attempt++;$.ajax({method:'GET',dataType:'json',timeout:1500,url:greenhouse}).done(function(response){if(typeof response.jobs!=='undefined'){_formatAndRenderData(response);}else{if(typeof response.error!=='undefined')
console.log('GREENHOUSE API ERROR: '+response.error);}}).fail(function(){console.log('GREENHOUSE API ERROR: Timeout on response, over '+(_attempt*1.5)+' seconds');if(_attempt<3){console.log('GREENHOUSE API: retry request '+_attempt);_requestJobs();}});}
function _renderIntent(){var job,keySubset={};_renderJobsByDepartment();if(typeof globs.urlparameters!=='undefined'){keySubset=R.pick(_queryKeys,globs.urlparameters);if(Object.keys(keySubset).length>0){if(typeof keySubset.department!=='undefined'){$(".job-filter[data-filter-value='"+keySubset.department+"']").trigger("click");}
if(typeof keySubset.location!=='undefined'){$(".job-filter[data-filter-value='"+keySubset.location+"']").trigger("click");}
if(typeof keySubset.job!=='undefined'){job=R.find(R.find(R.propEq('id',Number(keySubset.job))),R.pluck('list',_jobs.departments));if(typeof job!=='undefined'){_renderJobDetail(keySubset.job,job[0].departmentFilter);}}
if(typeof keySubset.gh_jid!=='undefined'){job=R.find(R.find(R.propEq('id',Number(keySubset.gh_jid))),R.pluck('list',_jobs.departments));if(typeof job!=='undefined'){if(typeof keySubset.gh_src!=='undefined'){_renderJobDetail(keySubset.gh_jid,job[0].departmentFilter);}else{_filterFns['department']=undefined;_filterFns['location']=undefined;_filterFns['job']=undefined;_filterFns['gh_jid']=keySubset.gh_jid;_updateQueryString(_filterFns);_mode$.removeClass('active');$('#application').addClass('active');_load("https://boards.greenhouse.io/embed/job_board/js?for=daybreakgames",_scriptLoaderCallback,keySubset.gh_jid);}}}}}}
function _departmentOrLocationFilter(e){e.preventDefault();$('.typeahead').val('');var target$=$(e.target),list$=target$.closest('.dropdown-menu'),dropdown$=list$.parent().children('.dropdown-toggle'),listItems$=list$.children('li'),filter={},scrollTarget$,chevron='<span class="chevron"></span>';filter.text=target$.text();filter.type=target$.attr('rel');filter.name=target$.attr('data-filter-value');_filterFns[filter.type]=filter.name;target$.text(dropdown$.text());target$.attr('data-filter-value',dropdown$.attr('data-filter-value')||null);dropdown$.html(filter.text+'&#160;'+chevron);dropdown$.attr('data-filter-value',filter.name||null);_sortListElement(list$,listItems$);_renderJobsByDepartment();_updateQueryString(_filterFns);_updateFilterHeader();if(typeof filter.type!=='undefined'&&typeof filter.name!=='undefined'){_reSet$.addClass('active');if(filter.type=='department'){scrollTarget$=$("#"+filter.name);_scrollToJobView(scrollTarget$.offset());}else{scrollTarget$=$("."+filter.name+":eq(0)");_scrollToJobView(scrollTarget$.offset());}}else{if(R.all(R.isNil,R.props(['department','gh_jid','job','location'],_filterFns))){_reSet$.removeClass('active');}}}
function _reSetFilters(e){e.preventDefault();$('.typeahead').val('');_filterFns['department']=undefined;_filterFns['location']=undefined;_filterFns['job']=undefined;_filterFns['gh_jid']=undefined;$(".dropdown-toggle[href='all_teams']").html("All Teams&#160;<span class='chevron'></span>").attr('data-filter-value',null);_jobDepartmentList$.html(_buildFilterListMarkup('department',_uniqueDepartmentFilters,_uniqueDepartments));$(".dropdown-toggle[href='all_locations']").html("All Locations&#160;<span class='chevron'></span>").attr('data-filter-value',null);_jobLocationList$.html(_buildFilterListMarkup('location',_uniqueLocationFilters,_uniqueLocations));_renderJobsByDepartment();_updateQueryString(_filterFns);_updateFilterHeader();_reSet$.removeClass('active');}
function _jobLinkClicked(e){e.preventDefault();var jobId=this.getAttribute('href');var department=this.getAttribute('rel');if(typeof jobId!=='undefined'&&typeof department!=='undefined'){_renderJobDetail(jobId,department);_filterFns['job']=jobId;_updateQueryString(_filterFns);}}
function _departmentToggleClicked(e){e.preventDefault();var dept=this.getAttribute('href');var text=this.text;if(typeof dept!=='undefined'){if(text=="–"){this.innerHTML='&#43;';_inclusiveFilter(false,dept);}else{this.innerHTML='&#150;';_inclusiveFilter(true,dept);}}}
function _applyButtonClicked(e){e.preventDefault();var jid=this.getAttribute('href');_filterFns['job']=undefined;_filterFns['gh_jid']=jid;_updateQueryString(_filterFns);_mode$.removeClass('active');$('#application').addClass('active');_load("https://boards.greenhouse.io/embed/job_board/js?for=daybreakgames",_scriptLoaderCallback,jid);}
function _backLinkClicked(e){e.preventDefault();_mode$.removeClass('active');$('#list').addClass('active');_filterFns['job']=undefined;_filterFns['gh_jid']=undefined;_updateQueryString(_filterFns);_detailContainer$.html('');_scriptUnload();var pos=window.pageYOffset||document.documentElement.scrollTop;$('.typeahead').val('');_scrollToJobView();}
function _jobBoxClicked(e){var href;e.preventDefault();href=this.getAttribute('href');$(".job-filter[data-filter-value='"+href+"']").trigger("click");_scrollToJobView($("#"+href).offset());}
function _mainCarouselScrollHandler(e){if(_carouselIndex<(_tagLines.length-1)){_carouselIndex++;}else{_carouselIndex=0}
setTimeout(function(){_blockHeadline$.text(_tagLines[_carouselIndex]);},800);}
function _scrollToJobView(pos){if(typeof pos!=='undefined'&&typeof pos.top!=='undefined'){$.Deferred(function(defer){$("html, body").animate({scrollTop:(pos.top-68)},500,defer.resolve);}).done(function(){});}else{$.Deferred(function(defer){$("html, body").animate({scrollTop:(_jobViewPosition.top-68)},500,defer.resolve);}).done(function(){});}}
function _updateFilterHeader(){var headerString='Viewing&#160;<span class="view-filter">All Teams&#160;</span>';var departmentFilter=$('.department-dropdown > .dropdown-toggle').attr('data-filter-value');var locationFilter=$('.location-dropdown > .dropdown-toggle').attr('data-filter-value');if(typeof departmentFilter!=='undefined'){var headerString='Viewing&#160;<span class="view-filter">'+$('.department-dropdown > .dropdown-toggle').text()+'</span>';}
if(typeof locationFilter!=='undefined'){headerString=headerString+'<span class="view-filter">in '+$('.location-dropdown > .dropdown-toggle').text()+'</span>';}
$('.current-view-filters').html(headerString);}
function _updateUrlParams(newParams){var newUrl;if(history.replaceState){newUrl=window.location.origin+window.location.pathname;if(newParams){newUrl=newUrl+'?'+newParams;}
window.history.replaceState(null,document.title,newUrl);}else{document.location.search=newParams;}}
function _dropdownToggleClicked(e){e.preventDefault();if(_jobListOrDetailContainer.hasClass('showing-job-detail')||_jobListOrDetailContainer.hasClass('showing-iframe')){if(e.target.getAttribute('aria-expanded')=='true'){}}}
function _scriptLoaderCallback(e,src,jid){var pos=window.pageYOffset||document.documentElement.scrollTop;if(typeof Grnhse!=='undefined'&&typeof jid!=='undefined'){Grnhse.Iframe.load(jid);_scrollToJobView();window.setTimeout(function(){pos=window.pageYOffset||document.documentElement.scrollTop;if(pos<4000){_scrollToJobView();}},1000);}}
function _scriptUnload(){var script=document.getElementById('greenhouseScript');if(script){script.parentNode.removeChild(script);}}
function _load(src,cb,jid){var cb=cb||function(){};var scriptTag=document.createElement('script');scriptTag.type='text/javascript';scriptTag.id='greenhouseScript';scriptTag.async=true;scriptTag.src=src;var onEnd=('onload'in scriptTag?_stdOnEnd:_ieOnEnd);onEnd(scriptTag,cb,jid);document.getElementsByTagName('head')[0].appendChild(scriptTag);}
function _stdOnEnd(scriptTag,cb,jid){scriptTag.onload=function(){this.onerror=this.onload=null;cb(null,this.src,jid);};scriptTag.onerror=function(){this.onerror=this.onload=null;cb(new Error('Failed to load '+this.src),scriptTag);};}
function _ieOnEnd(scriptTag,cb,jid){scriptTag.onreadystatechange=function(){if(this.readyState!=='complete'&&this.readyState!=='loaded'){return;}
scriptTag.onreadystatechange=null;cb(null,this.src,jid);};}
function pageLoaded(){_attempt=0;_mode$=$('.mode');_boxWrap$=$('#boxWrap');_jobCount$=$('.job-count');_jobList$=$('[name="joblist"]');_listContainer$=$('#jobsList');_reSet$=$('.re-set-view-filters');_detailContainer$=$('#jobDetail');_blockHeadline$=$('.block-headline');_jobLocationList$=$('#jobLocationList');_jobDepartmentList$=$('#jobDepartmentList');_jobViewPosition=$('[name="joblist"]').offset();_jobListOrDetailContainer=$('.job-list-or-detail-container');_jobBoxTemplate=_.template($('script.job-box-template').html());_jobDetailTemplate=_.template($('script.job-detail-template').html());_listDepartmentTemplate=_.template($('script.list-department-template').html());_requestJobs();_carouselIndex=0;$('.scroll-to-listings').on('click',_scrollToJobView);$('#themeCarousel').on('slide.bs.carousel',_mainCarouselScrollHandler);$(document).on('click','.job-box',_jobBoxClicked);$(document).on('click','.re-set-view-filters',_reSetFilters);$(document).on('click','.application-back-link',_backLinkClicked);$(document).on('click','.render-container .back-link',_backLinkClicked);$(document).on('click','.render-container .job-list-link',_jobLinkClicked);$(document).on('click','.render-container .apply-btn',_applyButtonClicked);$(document).on('click','.render-container .job-filter',_departmentOrLocationFilter);$(document).on('click','.render-container .department-toggle',_departmentToggleClicked);}
return{init:pageLoaded};})($,_);

/* end /scripts/_pages/careers.js*/

/* start /web-platform/scripts/web-platform/component/global-nav.js*/
(function(){'use strict';var nonMember=_.template($('script.non-member').html());var member=_.template($('script.member').html());if(globs.wdl.userLoggedIn){$.ajax({url:'/get-rest-ticket',type:'POST',data:{type:0},context:this,success:function(sid){$.ajax({url:globs.urls.uramAjaxUrl+'/rest/commerce/11/allaccessinfo.action',dataType:'json',data:{'theme':globs.wdl.theme,'responseType':'json','sessionID':sid.successPayload.ticket},success:function(data){var memberData={scGrantDate:data.scGrantDate,scGrantClaimed:data.scGrantClaimed,expirationDate:data.expirationDate};$('.currency-balance-item').each(function(){var $this=$(this);var presenceField=$this.attr('data-currency-presence-field');var balanceField=$this.attr('data-currency-balance-field');if(!presenceField||(Object.hasOwnProperty.call(data,presenceField)&&data[presenceField]===true)){if(Object.hasOwnProperty.call(data,balanceField)){$this.removeClass('hidden').find('.currency-balance').text(SOE.Utils.addSeparators(data[balanceField]));}}});if(!data.akella){if(!data.member){$('#brandBarAllAccess').html(nonMember());}else{$('#brandBarAllAccess').html(member(memberData));$('#brandBarIsMember').text('My');$('#membershipLink').click(function(e){e.preventDefault();window.location.href=globs.urls.membershipMembership;});}
$('ul#brandBarOptions').trigger('reset');}}});}});}else{$('#brandBarAllAccess').html(nonMember());}})();

/* end /web-platform/scripts/web-platform/component/global-nav.js*/
